pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.40 1998/03/28 14:58:31 grubba Exp $ +  * $Id: threads.h,v 1.41 1998/04/13 14:32:35 grubba 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:243:    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; + #ifdef THREAD_TRACE +  int t_flag; + #endif /* THREAD_TRACE */   };      #ifndef th_destroy   #define th_destroy(X)   #endif      #ifndef th_yield   #define th_yield()   #endif   
pike.git/src/threads.h:270:      /* Define to get a debug-trace of some of the threads operations. */   /* #define VERBOSE_THREADS_DEBUG */      #ifndef VERBOSE_THREADS_DEBUG   #define THREADS_FPRINTF(X)   #else   #define THREADS_FPRINTF(X) fprintf X   #endif /* VERBOSE_THREADS_DEBUG */    + #ifdef THREAD_TRACE + #define SWAP_OUT_TRACE(_tmp) do { extern int t_flag; (_tmp)->t_flag = t_flag; } while(0) + #define SWAP_IN_TRACE(_tmp) do { extern int t_flag; t_flag = (_tmp)->t_flag; } while(0) + #else /* !THREAD_TRACE */ + #define SWAP_OUT_TRACE(_tmp) + #define SWAP_IN_TRACE(_tmp) + #endif /* THREAD_TRACE */ +    #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)->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;\    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((stderr, "SWAP_OUT_CURRENT_THREAD() %s:%d t:%08x\n", \    __FILE__, __LINE__, (unsigned int)_tmp->thread_id)) \      #define SWAP_IN_CURRENT_THREAD() \