AThreads: prevent deadlock for event set before waited

This commit is contained in:
Marcus Sackrow 2022-05-28 22:46:50 +02:00
parent 4556cb35d1
commit 638de87a5a

View File

@ -1133,6 +1133,7 @@ begin
{$IFDEF DEBUG_AMIEVENT} {$IFDEF DEBUG_AMIEVENT}
SysDebugLn('AmiEvent: WaitFor Early Destroy'); SysDebugLn('AmiEvent: WaitFor Early Destroy');
{$ENDIF} {$ENDIF}
ReleaseSemaphore(@AmiEvent^.Sem);
Exit; Exit;
end; end;
if AmiEvent^.IsSet then if AmiEvent^.IsSet then
@ -1143,6 +1144,7 @@ begin
{$IFDEF DEBUG_AMIEVENT} {$IFDEF DEBUG_AMIEVENT}
SysDebugLn('AmiEvent: WaitFor Early Signaled'); SysDebugLn('AmiEvent: WaitFor Early Signaled');
{$ENDIF} {$ENDIF}
ReleaseSemaphore(@AmiEvent^.Sem);
Exit; Exit;
end; end;
// signal not set, so we add this call to the waiterlist // signal not set, so we add this call to the waiterlist