dora
dora copied to clipboard
feat(c/node): Make dora_next_event thread-safe
Feat: Make dora_next_event Thread-Safe
Which issue does this PR close?
- Closes #540
Rationale for this change
This change allows multiple threads to safely call dora_next_event concurrently while maintaining existing safety guarantees. The updates ensure that the DoraContext fields are accessed in a thread-safe manner.
What changes are included in this PR?
- feat(c/node): Make
dora_next_eventthread-safe- Wrap
DoraContextfields inArc<Mutex<>>for thread-safe access - Update
dora_next_eventto use shared references and mutex locking - Add comprehensive thread-safety documentation
- Make
dora_send_outputthread-safe - Add proper error handling for mutex lock failures
- Wrap
Are these changes tested?
Yes, the changes have been tested to ensure that dora_next_event and dora_send_output can be called safely from multiple threads without causing race conditions or deadlocks.
Are there any user-facing changes?
No, there are no user-facing changes as this update is related to internal thread-safety improvements.
Are there any breaking changes to public APIs?
No, there are no breaking changes to public APIs.