Avoid crash when trying to attach to a terminating process.

This commit is contained in:
Alexandre Julliard 2002-04-06 00:03:33 +00:00
parent 671577296e
commit ad16fc9e3b
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}
}
}