-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Remove _pthread_isduecanceled in favor of ->cancel. NFC. #15625
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
Conversation
Also simplify the wait in slices logic a bit, while we're at it.
@@ -8,15 +8,11 @@ | |||
#include "pthread_impl.h" | |||
#include <pthread.h> | |||
|
|||
int _pthread_isduecanceled(struct pthread* pthread_ptr) { |
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.
Sorry to be a pain but can you make the PR only about the removal of this function.. I really like simple PRs that do just one thing.
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.
No problem, I thought this simplification was too small for a dedicated PR, but maybe that doesn't matter. Reverted with commit 1bb8198.
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.
Nice!
@@ -73,7 +69,7 @@ int __timedwait_cp(volatile int *addr, int val, | |||
pthread_self()->cancelasync == PTHREAD_CANCEL_ASYNCHRONOUS) { | |||
double sleepUntilTime = emscripten_get_now() + msecsToSleep; | |||
do { | |||
if (_pthread_isduecanceled(pthread_self())) { | |||
if (pthread_self()->cancel) { |
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.
As a followup we should replace pthread_self
with __pthread_self
in all our musl-internal code.
Also, pthread_t self = __pthread_self();
would probably make sense here.
Also simplify the wait in slices logic a bit, while we're at it.I'll make another PR for that.Split from PR #15603.