pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.114 2002/09/13 19:18:00 mast Exp $ +  * $Id: threads.h,v 1.115 2002/09/14 02:58:49 mast Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "object.h"   #include "pike_error.h"   #include "interpret.h"      /* Needed for the sigset_t typedef, which is needed for
pike.git/src/threads.h:410:   #endif      #ifndef th_equal   #define th_equal(X,Y) (!MEMCMP(&(X),&(Y),sizeof(THREAD_T)))   #endif      #ifndef th_hash   #define th_hash(X) hashmem((unsigned char *)&(X),sizeof(THREAD_T), 16)   #endif    + #if !defined(HAVE_GETHRTIME) && defined(HAVE_CLOCK) + #ifdef HAVE_TIME_H + #include <time.h> + #endif + PMOD_EXPORT extern clock_t thread_start_clock; + #define USE_CLOCK_FOR_SLICES + #define DO_IF_USE_CLOCK_FOR_SLICES(X) X + #else + #define DO_IF_USE_CLOCK_FOR_SLICES(X) + #endif +    /* Define to get a debug-trace of some of the threads operations. */   /* #define VERBOSE_THREADS_DEBUG 0 */ /* Some debug */   /* #define VERBOSE_THREADS_DEBUG 1 */ /* Lots of debug */      #ifndef VERBOSE_THREADS_DEBUG   #define THREADS_FPRINTF(L,X)   #else   #define THREADS_FPRINTF(L,X) do { \    if ((VERBOSE_THREADS_DEBUG + 0) >= (L)) fprintf X; \    } while(0)
pike.git/src/threads.h:446:      #define SWAP_OUT_THREAD(_tmp) do { \    (_tmp)->state=Pike_interpreter; \    (_tmp)->swapped=1; \    DO_IF_PROFILING( (_tmp)->time_base += gethrtime() ; ) \    } while(0)      #define SWAP_IN_THREAD(_tmp) do { \    (_tmp)->swapped=0; \    Pike_interpreter=(_tmp)->state; \ +  DO_IF_USE_CLOCK_FOR_SLICES (thread_start_clock = 0); \    DO_IF_PROFILING( Pike_interpreter.time_base -= gethrtime();) \    } while(0)      #define SWAP_OUT_CURRENT_THREAD() \    do {\    struct thread_state *_tmp=OBJ2THREAD(Pike_interpreter.thread_id); \    SWAP_OUT_THREAD(_tmp); \    THREADS_FPRINTF(1, (stderr, "SWAP_OUT_CURRENT_THREAD() %s:%d t:%08x\n", \    __FILE__, __LINE__, (unsigned int)_tmp->thread_id)) \