mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 12:39:34 +01:00
Prevent occational crash in external tool threads with Sleep(1), especially with LazBuild. Issue #37883, patch from Ivon.
git-svn-id: trunk@64005 -
This commit is contained in:
parent
d81e9516c8
commit
ad65618c2b
@ -1225,12 +1225,14 @@ end;
|
||||
|
||||
procedure TAbstractExternalTool.EnterCriticalSection;
|
||||
begin
|
||||
Sleep(1); // Force context switch to prevent occational crash. Issue #36318, #37883 etc.
|
||||
FWorkerMessages.EnterCriticalSection;
|
||||
end;
|
||||
|
||||
procedure TAbstractExternalTool.LeaveCriticalSection;
|
||||
begin
|
||||
Assert(Assigned(FWorkerMessages), 'TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages=Nil.');
|
||||
Sleep(1);
|
||||
FWorkerMessages.LeaveCriticalSection;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user