2013-08-25, 13:46
hello
looking at CEvent, i found following situation:
thread A is already waiting on event. WaitMSec or Wait, never mind.
thread B is ready with some work and try to set this event.
BOOM, thread A owns 'mutex' lock ( CCriticalSection ) in Wait*, thread B tries to lock it too in Set, so event will be set only after WaitMSec times out or never in case of Wait. this way current Wait* will never succeed.
that is real situation i currently debug. currently this bug draws XP out of the game ( removing lock from Set brings it back to live ), but as code is generic and used across all platforms, this will become problematic on other platforms too.
while i do not see real issue with 'signaled' here, that is solved by this, i can propose distinct CriticalSection, ,guarding only it. didn't tried that yet.
looking at CEvent, i found following situation:
thread A is already waiting on event. WaitMSec or Wait, never mind.
thread B is ready with some work and try to set this event.
BOOM, thread A owns 'mutex' lock ( CCriticalSection ) in Wait*, thread B tries to lock it too in Set, so event will be set only after WaitMSec times out or never in case of Wait. this way current Wait* will never succeed.
that is real situation i currently debug. currently this bug draws XP out of the game ( removing lock from Set brings it back to live ), but as code is generic and used across all platforms, this will become problematic on other platforms too.
while i do not see real issue with 'signaled' here, that is solved by this, i can propose distinct CriticalSection, ,guarding only it. didn't tried that yet.