diff --git a/src/threads.c b/src/threads.c index 76e0535596d57eb7b5b89817de5daa199a02b039..d1863486f487bf8926937a007899c61ff4d553f3 100644 --- a/src/threads.c +++ b/src/threads.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: threads.c,v 1.100 1999/06/19 20:18:43 hubbe Exp $"); +RCSID("$Id: threads.c,v 1.101 1999/07/01 01:39:13 hubbe Exp $"); int num_threads = 1; int threads_disabled = 0; @@ -746,6 +746,11 @@ void f_mutex_lock(INT32 args) if(m->key) { + if(threads_disabled) + { + free_object(o); + error("Cannot wait for mutexes when threads are disabled!\n"); + } SWAP_OUT_CURRENT_THREAD(); do { @@ -900,6 +905,9 @@ void f_cond_wait(INT32 args) mut=OB2KEY(key)->mut; if(!mut) error("Bad argument 1 to condition->wait()\n"); + if(threads_disabled) + error("Cannot wait for conditions when threads are disabled!\n"); + /* Unlock mutex */ mut->key=0; OB2KEY(key)->mut=0;