pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.117 2001/11/01 18:40:12 mast Exp $ +  * $Id: threads.h,v 1.118 2001/11/02 14:05:33 mast Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "object.h"   #include "pike_error.h"   #include "interpret.h"   #include "pike_threadlib.h"      #ifdef PIKE_THREADS      struct svalue;   struct pike_frame;      extern PIKE_MUTEX_T interleave_lock;    - struct interleave_mutex - { -  struct interleave_mutex *next; -  struct interleave_mutex *prev; -  PIKE_MUTEX_T lock; - }; -  - #define IMUTEX_T struct interleave_mutex -  - #define DEFINE_IMUTEX(name) IMUTEX_T name -  - /* If threads are disabled, we already hold the lock. */ - #define LOCK_IMUTEX(im) do { \ -  if (!threads_disabled) { \ -  THREADS_FPRINTF(0, (stderr, "Locking IMutex 0x%p...\n", (im))); \ -  THREADS_ALLOW(); \ -  mt_lock(&((im)->lock)); \ -  THREADS_DISALLOW(); \ -  } \ -  } while(0) -  - /* If threads are disabled, the lock will be released later. */ - #define UNLOCK_IMUTEX(im) do { \ -  if (!threads_disabled) { \ -  THREADS_FPRINTF(0, (stderr, "Unlocking IMutex 0x%p...\n", (im))); \ -  mt_unlock(&((im)->lock)); \ -  } \ -  } while(0) -  +    #define THREAD_NOT_STARTED -1   #define THREAD_RUNNING 0   #define THREAD_EXITED 1      struct thread_state {    struct Pike_interpreter state;    char swapped;    char status;    COND_T status_change;    THREAD_T id;