Skip to content

Remove special case from pthread_kill.#26668

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:simplify_pthread_kill
Apr 11, 2026
Merged

Remove special case from pthread_kill.#26668
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:simplify_pthread_kill

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Apr 10, 2026

This special handling for SIGCANCEL should not be needed. If we need to do something like _emscripten_runtime_keepalive_clear during pthread cancelation it would be best done when the cancellation in processed in __testcancel/__cancel.

The comment & code I'm removing here was added back in #22467 along with testing in the form of test/pthread/test_pthread_kill.c and the pthread_kill tests in posixtest.

I recently expanded the testing in #26663, and this change doesn't break any of those tests.

This special handling for SIGCANCEL should not be needed.

If we need to do something like `_emscripten_runtime_keepalive_clear`
during pthread cancelation it would be best done when the cancellation
in processed in `__testcancel`/`__cancel`.

The comment and code I'm removing here was added back in emscripten-core#22467 along
with testing in the form of `test/pthread/test_pthread_kill.c` and the
pthread_kill tests in posixtest.

I recently expanded the testing in emscripten-core#26663, and this change doesn't break
any of those tests.
@sbc100 sbc100 requested review from dschuff and kripken April 10, 2026 19:27
@sbc100 sbc100 enabled auto-merge (squash) April 10, 2026 21:22
@sbc100 sbc100 requested a review from tlively April 11, 2026 00:21
Copy link
Copy Markdown
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good understanding of all the context about how threads are canceled, but the code LGTM.

@sbc100 sbc100 merged commit b3632b8 into emscripten-core:main Apr 11, 2026
27 checks passed
@sbc100 sbc100 deleted the simplify_pthread_kill branch April 11, 2026 01:59
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