mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 10:39:18 +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}
|
{$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
|
||||||
|
Loading…
Reference in New Issue
Block a user