Commit f14aa9b
committed
Allow late print calls from terminating pthreads
When a pthreaded application exits under PROXY_TO_PTHREAD and
EXIT_RUNTIME, the worker thread signals the main
thread to exit using the system queue. However, there can also be
messages from postMessage in-flight from the worker.
This results in a race condition where the main thread processes
the exit and terminates the worker (synchronously stubbing out its
onmessage handler to discard further messages) before processing
print messages already posted by the worker before exiting. As a
result, valid printed output is lost, and the test fails due to
unexpected assertion warnings.
Resolve this by allowing messages after termination. Fixes flaky test
test_pthread_print_override_modularize.
Fixes #196831 parent 999496e commit f14aa9b
2 files changed
Lines changed: 0 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | 594 | | |
606 | 595 | | |
607 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6166 | 6166 | | |
6167 | 6167 | | |
6168 | 6168 | | |
6169 | | - | |
6170 | | - | |
6171 | | - | |
6172 | | - | |
6173 | 6169 | | |
6174 | 6170 | | |
6175 | 6171 | | |
| |||
0 commit comments