pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.47 1998/08/06 19:46:56 grubba Exp $ +  * $Id: threads.h,v 1.48 1998/08/10 23:33:31 hubbe Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "interpret.h"   #include "object.h"   #include "error.h"   #ifdef HAVE_SYS_TYPES_H   /* Needed for pthread_t on OSF/1 */
pike.git/src/threads.h:43: Inside #if defined(_SGI_SPROC_THREADS)
  #ifdef _SGI_SPROC_THREADS   /* Not supported yet */   #undef SGI_SPROC_THREADS   #undef HAVE_SPROC   #endif /* _SGI_SPROC_THREADS */         extern int num_threads;   extern int live_threads;   struct object; + extern size_t thread_stack_size;   extern struct object *thread_id;      #define DEFINE_MUTEX(X) MUTEX_T X         #ifdef POSIX_THREADS   #define THREAD_T pthread_t   #define MUTEX_T pthread_mutex_t   #define mt_init(X) pthread_mutex_init((X),0)   #define mt_lock(X) pthread_mutex_lock(X)
pike.git/src/threads.h:110:   #define PTHREAD_MUTEX_INITIALIZER DEFAULTMUTEX   #define MUTEX_T mutex_t   #define mt_init(X) mutex_init((X),USYNC_THREAD,0)   #define mt_lock(X) mutex_lock(X)   #define mt_trylock(X) mutex_trylock(X)   #define mt_unlock(X) mutex_unlock(X)   #define mt_destroy(X) mutex_destroy(X)      #define th_setconcurrency(X) thr_setconcurrency(X)    - #define th_create(ID,fun,arg) thr_create(NULL,0,fun,arg,THR_DAEMON|THR_DETACHED,ID) + #define th_create(ID,fun,arg) thr_create(NULL,thread_stack_size,fun,arg,THR_DAEMON|THR_DETACHED,ID)   #define th_create_small(ID,fun,arg) thr_create(NULL,32768,fun,arg,THR_DAEMON|THR_DETACHED,ID)   #define th_exit(foo) thr_exit(foo)   #define th_self() thr_self()   #define th_yield() thr_yield()      #define COND_T cond_t   #define co_init(X) cond_init((X),USYNC_THREAD,0)   #define co_wait(COND, MUTEX) cond_wait((COND), (MUTEX))   #define co_signal(X) cond_signal(X)   #define co_broadcast(X) cond_broadcast(X)
pike.git/src/threads.h:274:    struct thread_state *hashlink, **backlink;       /* Swapped variables */    struct svalue *sp,*evaluator_stack;    struct svalue **mark_sp,**mark_stack;    struct frame *fp;    int evaluator_stack_malloced;    int mark_stack_malloced;    JMP_BUF *recoveries;    struct object * thread_id; +  char *stack_top;   #ifdef THREAD_TRACE    int t_flag;   #endif /* THREAD_TRACE */   };      #ifndef th_destroy   #define th_destroy(X)   #endif      #ifndef th_yield
pike.git/src/threads.h:325:   #define SWAP_OUT_THREAD(_tmp) do { \    (_tmp)->swapped=1; \    (_tmp)->evaluator_stack=evaluator_stack;\    (_tmp)->evaluator_stack_malloced=evaluator_stack_malloced;\    (_tmp)->fp=fp;\    (_tmp)->mark_sp=mark_sp;\    (_tmp)->mark_stack=mark_stack;\    (_tmp)->mark_stack_malloced=mark_stack_malloced;\    (_tmp)->recoveries=recoveries;\    (_tmp)->sp=sp; \ +  (_tmp)->stack_top=stack_top; \    (_tmp)->thread_id=thread_id;\    SWAP_OUT_TRACE(_tmp); \    } while(0)      #define SWAP_IN_THREAD(_tmp) do {\    (_tmp)->swapped=0; \    evaluator_stack=(_tmp)->evaluator_stack;\    evaluator_stack_malloced=(_tmp)->evaluator_stack_malloced;\    fp=(_tmp)->fp;\    mark_sp=(_tmp)->mark_sp;\    mark_stack=(_tmp)->mark_stack;\    mark_stack_malloced=(_tmp)->mark_stack_malloced;\    recoveries=(_tmp)->recoveries;\    sp=(_tmp)->sp;\ -  +  stack_top=(_tmp)->stack_top;\    thread_id=(_tmp)->thread_id;\    SWAP_IN_TRACE(_tmp); \    } while(0)      #define SWAP_OUT_CURRENT_THREAD() \    do {\    struct thread_state *_tmp=(struct thread_state *)thread_id->storage; \    SWAP_OUT_THREAD(_tmp); \    THREADS_FPRINTF(1, (stderr, "SWAP_OUT_CURRENT_THREAD() %s:%d t:%08x\n", \    __FILE__, __LINE__, (unsigned int)_tmp->thread_id)) \