Commit 4cdd2df
committed
Fix thread parking on WebAssembly
Sleeping instead of parking with a timeout is not okay, even
on the WebAssembly target, which currently only supports
the current thread runtime.
Reasons:
1. A task may have registered a timer and also woken itself.
Thus we need to continue execution immediately.
2. Even if Tokio only supports the current thread runtime on
WebAssembly, there exist multi-threaded targets like
wasm32-wasip1-threads. Thus a wake-up event can occur
from another thread (outside the Tokio runtime).1 parent 10e23d1 commit 4cdd2df
1 file changed
+0
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 68 | | |
72 | | - | |
73 | | - | |
74 | 69 | | |
75 | 70 | | |
76 | 71 | | |
| |||
0 commit comments