pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.56 1998/11/20 08:18:54 hubbe Exp $ +  * $Id: threads.h,v 1.57 1998/11/20 18:38:46 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:343:   #define SWAP_OUT_TRACE(_tmp)   #define SWAP_IN_TRACE(_tmp)   #endif /* THREAD_TRACE */      #if defined(PROFILING) && defined(HAVE_GETHRTIME)   #define DO_IF_PROFILING(X) X   #else   #define DO_IF_PROFILING(X)   #endif    + #ifdef DEBUG + #define DO_IF_DEBUG(X) X + #else + #define DO_IF_DEBUG(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 = gethrtime() - time_base; ) \ -  +  DO_IF_DEBUG( DO_IF_PROFILING( if(accounted_time<0) fatal("Accounted time out of whack!\n");)) \ +  DO_IF_DEBUG( DO_IF_PROFILING( if((_tmp)->time_base<0) fatal("time base out of whack!\n");)) \    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 + gethrtime(); ) \ -  +  DO_IF_DEBUG( DO_IF_PROFILING( if(accounted_time<0) fatal("Accounted time out of whack!\n");)) \ +  DO_IF_DEBUG( DO_IF_PROFILING( if(time_base<0) fatal("time base out of whack!\n");)) \    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)) \