pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.98 2000/07/12 05:57:39 neotron Exp $ +  * $Id: threads.h,v 1.99 2000/07/28 17:16:56 hubbe Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "object.h"   #include "error.h"   #include "interpret.h"      /* Needed for the sigset_t typedef, which is needed for
pike.git/src/threads.h:389: Inside #if undefined(VERBOSE_THREADS_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)   #endif /* VERBOSE_THREADS_DEBUG */      #ifdef THREAD_TRACE - #define SWAP_OUT_TRACE(_tmp) do { extern int t_flag; (_tmp)->status.t_flag = t_flag; } while(0) - #define SWAP_IN_TRACE(_tmp) do { extern int t_flag; t_flag = (_tmp)->status.t_flag; } while(0) + extern int t_flag; + #define SWAP_OUT_TRACE(_tmp) do { (_tmp)->status.t_flag = t_flag; } while(0) + #define SWAP_IN_TRACE(_tmp) do { t_flag = (_tmp)->status.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) X   #else   #define DO_IF_PROFILING(X)   #endif
pike.git/src/threads.h:452:   #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 THREADSTATE2OBJ(X) ((X)->state.thread_id)    + extern int Pike_in_gc;   #define THREADS_ALLOW() do { \    struct thread_state *_tmp=OBJ2THREAD(Pike_interpreter.thread_id); \    DO_IF_DEBUG({ \ -  extern int Pike_in_gc; \ +     if(thread_for_id(th_self()) != Pike_interpreter.thread_id) \    fatal("thread_for_id() (or Pike_interpreter.thread_id) failed!" \    " %p != %p\n", \    thread_for_id(th_self()), Pike_interpreter.thread_id); \    if (Pike_in_gc > 50 && Pike_in_gc < 300) \    fatal("Threads allowed during garbage collection.\n"); \    }) \    if(num_threads > 1 && !threads_disabled) { \    SWAP_OUT_THREAD(_tmp); \    THREADS_FPRINTF(1, (stderr, "THREADS_ALLOW() %s:%d t:%08x(#%d)\n", \
pike.git/src/threads.h:493:    } \    SWAP_IN_THREAD(_tmp);\    } \    DO_IF_DEBUG( if(thread_for_id(th_self()) != Pike_interpreter.thread_id) \    fatal("thread_for_id() (or Pike_interpreter.thread_id) failed! %p != %p\n",thread_for_id(th_self()),Pike_interpreter.thread_id) ; ) \    } while(0)      #define THREADS_ALLOW_UID() do { \    struct thread_state *_tmp_uid=OBJ2THREAD(Pike_interpreter.thread_id); \    DO_IF_DEBUG({ \ -  extern int Pike_in_gc; \ +     if(thread_for_id(th_self()) != Pike_interpreter.thread_id) \    fatal("thread_for_id() (or Pike_interpreter.thread_id) failed! %p != %p\n",thread_for_id(th_self()),Pike_interpreter.thread_id); \    if (Pike_in_gc > 50 && Pike_in_gc < 300) \    fatal("Threads allowed during garbage collection.\n"); \    }) \    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__, \