mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 05:49:15 +02:00
FpDebug: Linux, improve "Stop all" loop
git-svn-id: trunk@61833 -
This commit is contained in:
parent
595f8b9f3e
commit
e6e7bf4355
@ -1302,19 +1302,20 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// Signal all other threads to pause
|
// Signal all other threads to pause
|
||||||
for TDbgThread(ThreadToPause) in FThreadMap do begin
|
for TDbgThread(ThreadToPause) in FThreadMap do begin
|
||||||
if (ThreadToPause <> AThread) and (not ThreadToPause.FIsPaused) then begin
|
if (ThreadToPause <> AThread) then begin
|
||||||
|
while (not ThreadToPause.FIsPaused) do begin
|
||||||
|
|
||||||
// Check if any thread is already interrupted
|
// Check if any thread is already interrupted
|
||||||
while ExistsPendingSignal(Pid, WaitStatus, ThreadSignaled, True) do begin
|
while ExistsPendingSignal(Pid, WaitStatus, ThreadSignaled, True) do begin
|
||||||
if (ThreadSignaled = nil) or
|
if (ThreadSignaled = nil) or
|
||||||
(ThreadSignaled.CheckSignalForPostponing(WaitStatus))
|
(ThreadSignaled.CheckSignalForPostponing(WaitStatus))
|
||||||
then
|
then
|
||||||
FPostponedSignals.AddSignal(PID, WaitStatus);
|
FPostponedSignals.AddSignal(PID, WaitStatus);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
while not ThreadToPause.FIsPaused do begin
|
DebugLn(DBG_VERBOSE and (ThreadToPause.FInternalPauseRequested), ['Re-Request Internal pause for ', ThreadToPause.ID]);
|
||||||
ThreadToPause.FInternalPauseRequested:=false;
|
ThreadToPause.FInternalPauseRequested:=false;
|
||||||
if not ThreadToPause.RequestInternalPause then
|
if not ThreadToPause.RequestInternalPause then // will fail, if already paused
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ExistsPendingSignal(Pid, WaitStatus, ThreadSignaled, False) then begin
|
if ExistsPendingSignal(Pid, WaitStatus, ThreadSignaled, False) then begin
|
||||||
@ -1324,9 +1325,7 @@ begin
|
|||||||
FPostponedSignals.AddSignal(PID, WaitStatus);
|
FPostponedSignals.AddSignal(PID, WaitStatus);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DebugLn(DBG_VERBOSE and (not ThreadToPause.FIsPaused), ['Re-Request Internal pause for ', ThreadToPause.ID]);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$IFDEF DebuglnLinuxDebugEvents}
|
{$IFDEF DebuglnLinuxDebugEvents}
|
||||||
|
Loading…
Reference in New Issue
Block a user