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/02/10 21:46:58 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.90 1999/02/20 17:44:37 grubba 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:169:      void low_init_threads_disable(void)   {    /* Serious black magic to avoid dead-locks */       if (!threads_disabled) {    THREADS_FPRINTF(0,    (stderr, "low_init_threads_disable(): Locking IM's...\n"));       if (thread_id) { +  /* Threads have been enabled. */ +     IMUTEX_T *im;       THREADS_ALLOW();       /* Keep this the entire session. */    mt_lock(&interleave_lock);       im = (IMUTEX_T *)interleave_list;       while(im) {    mt_lock(&(im->lock));       im = im->next;    }       THREADS_DISALLOW();    } else { -  +  /* Threads haven't been enabled yet. */ +     IMUTEX_T *im;       /* Keep this the entire session. */    mt_lock(&interleave_lock);       im = (IMUTEX_T *)interleave_list;       while(im) {    mt_lock(&(im->lock));