Commit bc80cec8 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-10-23 10:54:14 by simonmar]

We should really delete the main thread in a deadlock situation,
otherwise if we somehow recover it might stay in the system
indefinitely.
parent 32eebc97
/* --------------------------------------------------------------------------- /* ---------------------------------------------------------------------------
* $Id: Schedule.c,v 1.100 2001/08/14 13:40:09 sewardj Exp $ * $Id: Schedule.c,v 1.101 2001/10/23 10:54:14 simonmar Exp $
* *
* (c) The GHC Team, 1998-2000 * (c) The GHC Team, 1998-2000
* *
...@@ -582,12 +582,14 @@ schedule( void ) ...@@ -582,12 +582,14 @@ schedule( void )
StgMainThread *m = main_threads; StgMainThread *m = main_threads;
#ifdef SMP #ifdef SMP
for (; m != NULL; m = m->link) { for (; m != NULL; m = m->link) {
deleteThread(m->tso);
m->ret = NULL; m->ret = NULL;
m->stat = Deadlock; m->stat = Deadlock;
pthread_cond_broadcast(&m->wakeup); pthread_cond_broadcast(&m->wakeup);
} }
main_threads = NULL; main_threads = NULL;
#else #else
deleteThread(m->tso);
m->ret = NULL; m->ret = NULL;
m->stat = Deadlock; m->stat = Deadlock;
main_threads = m->link; main_threads = m->link;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment