Skip to content

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.
#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!

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