27 Sep
2022
27 Sep
'22
2:35 p.m.
On Tue Sep 27 11:37:44 2022 +0000, Piotr Caban wrote:
There's a race in case of concurrent _RunAndWait execution: ``` thread 1 - runs _RunAndWait and gets to RtlWaitOnAddress call (expected = 2; this->finished = 1) thread 2 - runs _RunAndWait and gets to RtlWaitOnAddress call (expected = 2; this->finished = 1) thread 3 - executed the chore and calls RtlWakeAddressAll thread 1 - wakes, exits the loop since expected = 2 and this->finished = 2 thread 1 - sets this->finished = 0 thread 2 - wakes and waits again since expected = 2 and this->finished = 0 ``` makes sense, I'll need to test if concurrent `_RunAndWait` is allowed, if it is my current approach will not work.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/906#note_9389