pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.61 1999/01/31 09:02:04 hubbe Exp $ +  * $Id: threads.h,v 1.62 1999/02/01 04:11:37 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:385:    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 = gethrtime() - (_tmp)->time_base; ) \    SWAP_IN_TRACE(_tmp); \    } while(0)      #define SWAP_OUT_CURRENT_THREAD() \    do {\ -  struct thread_state *_tmp=(struct thread_state *)thread_id->storage; \ +  struct thread_state *_tmp=OBJ2THREAD(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)) \      #define SWAP_IN_CURRENT_THREAD() \    THREADS_FPRINTF(1, (stderr, "SWAP_IN_CURRENT_THREAD() %s:%d ... t:%08x\n", \    __FILE__, __LINE__, (unsigned int)_tmp->thread_id)); \    SWAP_IN_THREAD(_tmp);\    } while(0)   
pike.git/src/threads.h:419:      /* Note that the semi-colon below is needed to add an empty statement    * in case there is a label before the macro.    */   #define REVEAL_GLOBAL_VARIABLES() ; } while(0)   #else /* PIKE_DEBUG */   #define HIDE_GLOBAL_VARIABLES()   #define REVEAL_GLOBAL_VARIABLES()   #endif /* PIKE_DEBUG */    + #define OBJ2THREAD(X) \ +  ((struct thread_state *)((X)->storage+thread_storage_offset))      #define THREADS_ALLOW() do { \ -  struct thread_state *_tmp=(struct thread_state *)thread_id->storage; \ +  struct thread_state *_tmp=OBJ2THREAD(thread_id); \    if(num_threads > 1 && !threads_disabled) { \    SWAP_OUT_THREAD(_tmp); \    THREADS_FPRINTF(1, (stderr, "THREADS_ALLOW() %s:%d t:%08x(#%d)\n", \    __FILE__, __LINE__, \    (unsigned int)_tmp->thread_id, live_threads)); \    mt_unlock(& interpreter_lock); \    } else {} \    HIDE_GLOBAL_VARIABLES()      #define THREADS_DISALLOW() \
pike.git/src/threads.h:448:    while (threads_disabled) { \    THREADS_FPRINTF(1, (stderr, \    "THREADS_DISALLOW(): Threads disabled\n")); \    co_wait(&threads_disabled_change, &interpreter_lock); \    } \    SWAP_IN_THREAD(_tmp);\    } \    } while(0)      #define THREADS_ALLOW_UID() do { \ -  struct thread_state *_tmp_uid=(struct thread_state *)thread_id->storage; \ +  struct thread_state *_tmp_uid=OBJ2THREAD(thread_id); \    if(num_threads > 1 && !threads_disabled) { \    SWAP_OUT_THREAD(_tmp_uid); \    live_threads++; \    THREADS_FPRINTF(1, (stderr, "THREADS_ALLOW_UID() %s:%d t:%08x(#%d)\n", \    __FILE__, __LINE__, \    (unsigned int)_tmp_uid->thread_id, live_threads)); \    mt_unlock(& interpreter_lock); \    } else {} \    HIDE_GLOBAL_VARIABLES()   
pike.git/src/threads.h:560: Inside #if defined(__NT__)
     #ifdef __NT__   #ifndef PIKE_DEBUG   #define CheckValidHandle(X) 0   #else   void CheckValidHandle(HANDLE h);   #endif   #endif      extern int threads_disabled; + extern int thread_storage_offset;      #endif /* THREADS_H */