Remove some of the complexity from __timedwait.c. NFC#26511
Remove some of the complexity from __timedwait.c. NFC#26511sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
|
What gemini had to say about this change: ✦ I have reviewed your proposed changes at HEAD. The changes in system/lib/libc/musl/src/thread/__timedwait.c appear to be a sound cleanup and Key Observations:
Minor Considerations:
Overall, the change looks excellent and improves both the code quality and size without regressing functionality. |
|
So on the main thread, does this mean that timedwait will slice the sleep to 100ms and futex may slice to 1ms (or 100ms) also? |
Yes I believe if you enter In addition, if you are the main runtime thread the futex_wait will then slice that 100ms into 1ms slices. |
This should have been part of emscripten-core#26471. The breaking up of the wait time for 2 of the 3 cases that are handled here is now handled one layer own in emscripten_futex_wait: 1. Breaking up the wait because we are the main runtime thread. 2. Breaking up the wait because we are async cancelable. The third cases here (breaking up the wait because we are cancelable in the non-async sense) still needs to be handled here at the higher level.
This should have been part of #26471.
The breaking up of the wait time for 2 of the 3 cases that are handled here is now handled one layer down in
emscripten_futex_wait:The third cases here (breaking up the wait because we are cancelable in the non-async sense) still needs to be handled here at the higher level.