27 Sep
2022
27 Sep
'22
2:33 p.m.
On Tue Sep 27 11:29:34 2022 +0000, Torge Matthies wrote:
this->finished may be zeroed by another \_RunAndWait call. `this->finished` is only zeroed after all chores complete though? 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
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/906#note_9388