Open JoelLinn opened 4 years ago
The rules of suspension probably apply to termination also — on Windows we don't seem to care either.
Edit: I addressed this in #1992
Posting this in here since the ticket is most relevant to the region and I don't want to create another. So as established in #1678, the condition is global and a completely unrelated wait might be signalled.
So what if our conditions are untouched by the initiating signal that woke us? How does another thread that really waits on the source signal get the message? I think this is the main issue here.
I think we need to maintain a list of waits and ~(option A) loop through it on every new signal (under the lock protection), checking if the other (if any) objects are also signalled and select the first matching wait list. Or~ (option B) notify all threads and have them check individually.
From PR #1317:
https://github.com/xenia-project/xenia/blob/d1f7ee35933b1eb0ba8a87c406538a8e81a30662/src/xenia/base/threading_posix.cc#L220-L223
@Triang3l :