pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.75 1998/07/10 15:52:06 grubba Exp $"); + RCSID("$Id: threads.c,v 1.76 1998/07/16 23:46:15 hubbe Exp $");      int num_threads = 1;   int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "object.h"   #include "pike_macros.h"   #include "callback.h"
pike.git/src/threads.c:200:    THREADS_FPRINTF(0,    (stderr, "init_threads_disable(): Disabling threads.\n"));       threads_disabled = 1;    } else {    threads_disabled++;    }       THREADS_FPRINTF(0, (stderr, "init_threads_disable(): threads_disabled:%d\n",    threads_disabled)); +  +  if(live_threads) +  { +  SWAP_OUT_CURRENT_THREAD();    while (live_threads) {    THREADS_FPRINTF(0,    (stderr,    "_disable_threads(): Waiting for %d threads to finish\n",    live_threads));    co_wait(&live_threads_change, &interpreter_lock);    } -  +  SWAP_IN_CURRENT_THREAD();    } -  + }      void exit_threads_disable(struct object *o)   {    THREADS_FPRINTF(0, (stderr, "exit_threads_disable(): threads_disabled:%d\n",    threads_disabled));    if(threads_disabled) {    if(!--threads_disabled) {    IMUTEX_T *im = (IMUTEX_T *)interleave_list;       /* Order shouldn't matter for unlock, so no need to do it backwards. */