Repository navigation
Commit dabfa55
authored
Keep the current task per thread on WASIp3 (#1792)
`wasip3_task_set` stored the current task in a plain global. With
cooperative threads, a thread that runs while another thread is suspended
inside a poll reads and overwrites that thread's current task.
On WASIp3, `wasip3_task_set` is now defined in the WASIp3 TLS helper, with
`WASIP3_TASK` as `_Thread_local`, so each thread with its own TLS block has
its own current task.
Other targets keep the MVP build with a plain global, since compiling
`_Thread_local` as MVP marks the object as incompatible with shared memory.
`wasip3_task_set` is a weak symbol, so a component that also links an older
version of `wit-bindgen` can still end up with that version's definition.1 parent 064cb07 commit dabfa55
5 files changed
Lines changed: 25 additions & 1 deletion
File tree
- ci
- crates/guest-rust
- src/rt
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
134 | 148 | | |
135 | 149 | | |
136 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Binary file not shown.
0 commit comments