Don't send an extra signal when waiting for a debug event, just do a
normal wait. Return the debug event status directly as return value
of the server call.
diff --git a/server/thread.c b/server/thread.c
index bddabb0..6b83fe0 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -315,6 +315,7 @@
/* stop a thread (at the Unix level) */
void stop_thread( struct thread *thread )
{
+ if (thread->context) return; /* already inside a debug event, no need for a signal */
/* can't stop a thread while initialisation is in progress */
if (is_process_init_done(thread->process)) send_thread_signal( thread, SIGUSR1 );
}