Branch: Tag:

1999-07-01

1999-07-01 01:39:13 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

fixed a potentially serious thread bug

Rev: src/threads.c:1.101

1:   #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:       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:    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;