Skip to content

[pthread] Clear waitAsync waiter in returnWorkerToPool to prevent deadlock - #27501

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:fix-waitasync-deadlock
Open

[pthread] Clear waitAsync waiter in returnWorkerToPool to prevent deadlock#27501
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:fix-waitasync-deadlock

Conversation

@sbc100

@sbc100 sbc100 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

When a thread exits and its worker is returned to pool, clear any pending Atomics.waitAsync waiter armed on the thread's structure before freeing its memory in _emscripten_thread_free_data.

Fixes: #27492

…dlock

When a thread exits and its worker is returned to pool, clear any
pending `Atomics.waitAsync` waiter armed on the thread's structure before
freeing its memory in `_emscripten_thread_free_data`.

Fixes: emscripten-core#27492
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.

std::condition_variable::notify_all() doesn't reliably notify threads resulting in deadlocks

1 participant