Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix thread safety #567

Merged
merged 3 commits into from
Mar 18, 2023
Merged

Conversation

rhaschke
Copy link
Contributor

Problem:
Using process(...) within an event handler triggered from multiple threads in parallel causes a segfault, because the access to the root machine's process_ queue was unprotected. The problem is illustrated in a new unit test.

Solution:
I moved the mutex lock from some very deep process_event_impl functions to the top-level process_event.
This solution also eliminates the need for a recursive_mutex when using process.

@krzysztof-jusiak krzysztof-jusiak merged commit d5adcee into boost-ext:master Mar 18, 2023
@krzysztof-jusiak
Copy link
Collaborator

Awesome, thank you @rhaschke

@rhaschke rhaschke deleted the fix-thread-safety branch March 18, 2023 15:25
@rhaschke
Copy link
Contributor Author

@krzysztof-jusiak, this was a really fast merge!
What is your take on #562 (comment), which is another pressing issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants