Avoid crash when trying to attach to a terminating process.
This commit is contained in:
parent
671577296e
commit
ad16fc9e3b
|
@ -539,9 +539,11 @@ void suspend_process( struct process *process )
|
|||
if (!process->suspend++)
|
||||
{
|
||||
struct thread *thread = process->thread_list;
|
||||
for (; thread; thread = thread->proc_next)
|
||||
while (thread)
|
||||
{
|
||||
struct thread *next = thread->proc_next;
|
||||
if (!thread->suspend) stop_thread( thread );
|
||||
thread = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -553,9 +555,11 @@ void resume_process( struct process *process )
|
|||
if (!--process->suspend)
|
||||
{
|
||||
struct thread *thread = process->thread_list;
|
||||
for (; thread; thread = thread->proc_next)
|
||||
while (thread)
|
||||
{
|
||||
struct thread *next = thread->proc_next;
|
||||
if (!thread->suspend) continue_thread( thread );
|
||||
thread = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue