pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.53 1998/09/05 20:08:27 grubba Exp $ +  * $Id: threads.h,v 1.54 1998/11/20 01:57:24 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:288:       /* 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 PROFILING + #ifdef HAVE_GETHRTIME +  long long accounted_time; +  long long time_base; + #endif + #endif +    #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:329:   #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 */    + #if defined(PROFILING) && defined(HAVE_GETHRTIME) + #define DO_IF_PROFILING(X) + #else + #define DO_IF_PROFILING(X) + #endif +    #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;\ -  +  DO_IF_PROFILING( (_tmp)->accounted_time=accounted_time; ) \ +  DO_IF_PROFILING( (_tmp)->time_base = gethrvtime() - time_base; ) \    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;\ -  +  DO_IF_PROFILING( accounted_time=(_tmp)->accounted_time; ) \ +  DO_IF_PROFILING( time_base = (_tmp)->time_base + gethrvtime(); ) \    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)) \