pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.20 1997/03/17 03:04:44 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.21 1997/04/16 03:09:18 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" -  + #include "builtin_functions.h" + #include "constants.h"         struct object *thread_id;   static struct callback *threads_evaluator_callback=0;      MUTEX_T interpreter_lock = PTHREAD_MUTEX_INITIALIZER;   struct program *mutex_key = 0;   struct program *thread_id_prog = 0;   #ifdef POSIX_THREADS   pthread_attr_t pattr;
pike.git/src/threads.c:38:   }      void *new_thread_func(void * data)   {   /* static int dbt;*/    struct thread_starter arg = *(struct thread_starter *)data;    JMP_BUF back;    INT32 tmp;      /* fprintf(stderr, "Thread create[%d]...",dbt++);*/ -  if(tmp=mt_lock( & interpreter_lock)) +  if((tmp=mt_lock( & interpreter_lock)))    fatal("Failed to lock interpreter, errno %d\n",tmp);   /* fprintf(stderr,"Created[%d]...",dbt);*/    free((char *)data); /* Moved by per, to avoid some bugs.... */    init_interpreter();       thread_id=arg.id;       if(SETJMP(back))    {    ONERROR tmp;