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