diff --git a/CHANGELOG.md b/CHANGELOG.md index b377a33..20549b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Calling `ovni_thread_isready()` after `ovni_thread_free()` now returns 0. +- Emitting events in a non-ready thread now aborts the program with a + message rather than causing a segfault. ## [1.5.0] - 2023-12-15 diff --git a/src/rt/ovni.c b/src/rt/ovni.c index 3c7bcdf..537a8fb 100644 --- a/src/rt/ovni.c +++ b/src/rt/ovni.c @@ -767,6 +767,9 @@ add_flush_events(uint64_t t0, uint64_t t1) static void ovni_ev_add_jumbo(struct ovni_ev *ev, const uint8_t *buf, uint32_t bufsize) { + if (!rthread.ready) + die("thread is not initialized"); + int flushed = 0; uint64_t t0, t1; @@ -808,6 +811,9 @@ ovni_ev_add_jumbo(struct ovni_ev *ev, const uint8_t *buf, uint32_t bufsize) static void ovni_ev_add(struct ovni_ev *ev) { + if (!rthread.ready) + die("thread is not initialized"); + int flushed = 0; uint64_t t0, t1;