-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Segmentation fault on calling thread.join due to destructor also calling thread.join #292
Comments
🤔 |
CC @stefanofiorentino do you know how it works under the hood within |
Let me check some internals.. |
@wirepair as in uvw we are leveraging the RAII pattern, the destructor of the of uvw::thread is already calling join, so currently you could not call it by yourself. @skypjack we can either put join private or create an invariant to avoid the second call to join in case the public join has been called. I guess giving the user the freedom to force a join is the way to go, do you agree? |
Signed-off-by: Fiorentino, Stefano <[email protected]>
Signed-off-by: Fiorentino, Stefano <[email protected]>
Yeah, makes sense. A boolean member is enough for that probably. Not a big deal. 👍 |
Signed-off-by: Fiorentino, Stefano <[email protected]>
Code to replicate:
Took me a while to debug, and only occurred when i had > 4 threads (???) but I get a segmentation fault since
join()
is being called twice (once by me, and once on exiting the main function scope). I'm not sure how we can call join if it's also apart of the destructor?Here's the backtrace:
The text was updated successfully, but these errors were encountered: