-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: Add support for external threads attaching/detaching re context. (
#414) This commit allows to create an event loop context and keep a reference to it in the caller application. After that, this and other threads are allowed to attach to and detach from this context as needed. Threads are synchronized by calling re_thread_enter/leave. The re context can be destroyed by calling mem_deref. This is useful to allow threads that are not running event loop to invoke methods on an event loop context that is created and managed by another thread.
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c0cb714
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these three new API functions alternative to re_thread_init (called by libre_init) and re_thread_enter/leave?
c0cb714
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only needed if you need more control and want to avoid the re_global fallback for non-re threads.