Skip to content

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

Merged
merged 2 commits into from
Nov 30, 2021

Conversation

kleisauke
Copy link
Collaborator

@kleisauke kleisauke commented Nov 24, 2021

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.

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) {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

kleisauke added a commit to kleisauke/emscripten that referenced this pull request Nov 29, 2021
Copy link
Collaborator

@sbc100 sbc100 left a 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) {
Copy link
Collaborator

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.

@sbc100 sbc100 merged commit 9cfcefb into emscripten-core:main Nov 30, 2021
@kleisauke kleisauke deleted the remove-isduecanceled branch November 30, 2021 09:28
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.

2 participants