pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.110 2000/02/10 18:03:29 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.111 2000/02/15 02:37:58 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:189: Inside #if defined(SIMULATE_COND_WITH_EVENT)
   if(t) return -1;    mt_destroy(& c->lock);    return 0;   }      #endif         #define THIS_THREAD ((struct thread_state *)fp->current_storage)    - struct object *thread_id; + struct object *thread_id = NULL;   static struct callback *threads_evaluator_callback=0;   int thread_id_result_variable;      MUTEX_T interpreter_lock, thread_table_lock, interleave_lock;   struct program *mutex_key = 0;   struct program *thread_id_prog = 0;   struct program *thread_local_prog = 0;   #ifdef POSIX_THREADS   pthread_attr_t pattr;   pthread_attr_t small_pattr;
pike.git/src/threads.c:1281:       thread_id=clone_object(thread_id_prog,0);    SWAP_OUT_THREAD(OBJ2THREAD(thread_id)); /* Init struct */    OBJ2THREAD(thread_id)->swapped=0;    OBJ2THREAD(thread_id)->id=th_self();    thread_table_insert(thread_id);   }      void th_cleanup(void)   { +  if(thread_id) +  { +  destruct(thread_id); +  free_object(thread_id); +  thread_id=0; +  } +     if(mutex_key)    {    free_program(mutex_key);    mutex_key=0;    }       if(thread_local_prog)    {    free_program(thread_local_prog);    thread_local_prog=0;    }       if(thread_id_prog)    {    free_program(thread_id_prog);    thread_id_prog=0;    } -  -  if(thread_id) -  { -  destruct(thread_id); -  free_object(thread_id); -  thread_id=0; +    } - } +       /* Thread farm code by Per    *    */   static struct farmer {    struct farmer *neighbour;    void *field;    void (*harvest)(void *);    THREAD_T me;    COND_T harvest_moon;