You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[wasmfs] Fix data race in thread initialization. (#25114)
The `ProxyWorker` was creating a thread in the constructor initializer
list and using a captured reference to the `started` member variable.
This is problematic because it is not guaranteed that the class has been
fully constructed during the initializer list.
What happens:
1) `ProxyWorker` initializers run
2) Thread starts and sets `started = true`
3) `ProxyWorker` finishes construction and sets `started = false`
4) `ProxyWorker` waits for `started` to be `true`
Step 4 will never finish in this case since the thread already ran.
To fix this we simply need to move the thread creation into the
constructor body where the class is guaranteed to be fully constructed.
Fixes#24370, #24676, #20650
0 commit comments