Skip to content

Remove loop from emscripten_thread_sleep. NFC#26585

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:emscripten_thread_sleep
Open

Remove loop from emscripten_thread_sleep. NFC#26585
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:emscripten_thread_sleep

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Mar 31, 2026

We have code in the lower level emscrpeten_futex_wait that take care of splitting up the wait for the main runtime thread. For normal pthreads I don't see any need to run the message queue while the thread is sleeping like this.

Instead, it can run from the event loop, or explicitly run.

Followup to #26471

@sbc100 sbc100 force-pushed the emscripten_thread_sleep branch 3 times, most recently from c8d8cfa to 6fa2130 Compare March 31, 2026 23:52
We have code in the lower level emscrpeten_futex_wait that take care
of splitting up the wait for the main runtime thread.  For normal
pthreads I don't see any need to run the message queue while the thread
is sleeping like this.

Instead, it can run from the event loop, or explicitly run.

Followup to emscripten-core#26471
@sbc100 sbc100 force-pushed the emscripten_thread_sleep branch from 6fa2130 to a5a8564 Compare April 1, 2026 00:47
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.

1 participant