-
Notifications
You must be signed in to change notification settings - Fork 226
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
Safer thread parkers #110
Safer thread parkers #110
Conversation
8808a37
to
c53cb2f
Compare
The warnings about |
c53cb2f
to
dcd6019
Compare
dcd6019
to
e3da313
Compare
e3da313
to
a70199b
Compare
Continuing the work of trying to remove
unsafe
from methods/functions that actually can't result in UB.I know the spin based generic thread parker is also in the other PR (#106). But it was kind of needed here to get rid of unsafe
prepare_unpark
on (almost) all platforms. I will remove that commit from the other PR if/when this is merged.I left the two constructors of the Windows thread parkers as unsafe. The documentation for
GetModuleHandleA
suggests it has to be carefully called and used in a multi threaded environment. At the same time I'm not sure what exactly could cause it to fail, or if that is even possible in our setup. If you have more information on the topic, maybe we can safely mark them as safe?