pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.89 1999/07/01 01:43:06 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.90 2000/02/11 02:11:26 hubbe Exp $");      int num_threads = 1;   int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "mapping.h"   #include "object.h"   #include "pike_macros.h"
pike.git/src/threads.c:625:      void f_mutex_lock(INT32 args)   {    struct mutex_storage *m;    struct object *o;       m=THIS_MUTEX;    /* Needs to be cloned here, since create()    * might use threads.    */ -  o=clone_object(mutex_key,0); +     if(!args || IS_ZERO(sp-args))    {    if(m->key && OB2KEY(m->key)->owner == thread_id)    {    THREADS_FPRINTF(0,    (stderr, "Recursive LOCK k:%08x, m:%08x(%08x), t:%08x\n",    (unsigned int)OB2KEY(m->key),    (unsigned int)m,    (unsigned int)OB2KEY(m->key)->mut,    (unsigned int) thread_id)); -  free_object(o); +     error("Recursive mutex locks!\n");    }    } -  +  o=clone_object(mutex_key,0);       if(m->key)    {    if(threads_disabled)    {    free_object(o);    error("Cannot wait for mutexes when threads are disabled!\n");    }       SWAP_OUT_CURRENT_THREAD();