mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 09:28:19 +02:00
AThreads: prevent deadlock for event set before waited
This commit is contained in:
parent
4556cb35d1
commit
638de87a5a
@ -1133,6 +1133,7 @@ begin
|
||||
{$IFDEF DEBUG_AMIEVENT}
|
||||
SysDebugLn('AmiEvent: WaitFor Early Destroy');
|
||||
{$ENDIF}
|
||||
ReleaseSemaphore(@AmiEvent^.Sem);
|
||||
Exit;
|
||||
end;
|
||||
if AmiEvent^.IsSet then
|
||||
@ -1143,6 +1144,7 @@ begin
|
||||
{$IFDEF DEBUG_AMIEVENT}
|
||||
SysDebugLn('AmiEvent: WaitFor Early Signaled');
|
||||
{$ENDIF}
|
||||
ReleaseSemaphore(@AmiEvent^.Sem);
|
||||
Exit;
|
||||
end;
|
||||
// signal not set, so we add this call to the waiterlist
|
||||
|
Loading…
Reference in New Issue
Block a user