pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.122 2004/03/09 10:07:12 grubba Exp $ +  * $Id: threads.h,v 1.123 2004/05/01 12:19:47 mast Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "object.h"   #include "pike_error.h"   #include "interpret.h"   #include "main.h"   
pike.git/src/threads.h:539:    DO_IF_USE_CLOCK_FOR_SLICES (thread_start_clock = 0); \    DO_IF_PROFILING( Pike_interpreter.time_base -= gethrtime();) \    SWAP_IN_TRACE(_tmp); \    } 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)) \ +  __FILE__, __LINE__, (unsigned int)_tmp->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)); \ +  __FILE__, __LINE__, (unsigned int)_tmp->id)); \    SWAP_IN_THREAD(_tmp);\    } while(0)      #if defined(PIKE_DEBUG) && ! defined(DONT_HIDE_GLOBALS)   /* Note that scalar types are used in place of pointers and vice versa    * below. This is intended to cause compiler warnings/errors if    * there is an attempt to use the global variables in an unsafe    * environment.    */   #define HIDE_GLOBAL_VARIABLES() do { \
pike.git/src/threads.h:587:    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", \    __FILE__, __LINE__, \ -  (unsigned int)_tmp->thread_id, live_threads)); \ +  (unsigned int)_tmp->id, live_threads)); \    mt_unlock_interpreter(); \    } else {} \    HIDE_GLOBAL_VARIABLES()      #define THREADS_DISALLOW() \    REVEAL_GLOBAL_VARIABLES(); \    if(_tmp->swapped) { \    mt_lock_interpreter(); \    THREADS_FPRINTF(1, (stderr, "THREADS_DISALLOW() %s:%d t:%08x(#%d)\n", \    __FILE__, __LINE__, \ -  (unsigned int)_tmp->thread_id, live_threads)); \ +  (unsigned int)_tmp->id, live_threads)); \    while (threads_disabled) { \    THREADS_FPRINTF(1, (stderr, \    "THREADS_DISALLOW(): Threads disabled\n")); \    co_wait_interpreter(&threads_disabled_change); \    } \    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)
pike.git/src/threads.h:628:    fprintf(stderr, __FILE__ ":" DEFINETOSTR(__LINE__) ": Fatal error:\n"); \    debug_fatal("Threads allowed during garbage collection (%d).\n", \    Pike_in_gc); \    } \    }) \    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)); \ +  (unsigned int)_tmp_uid->id, live_threads)); \    mt_unlock_interpreter(); \    } else {} \    HIDE_GLOBAL_VARIABLES()      #define THREADS_DISALLOW_UID() \    REVEAL_GLOBAL_VARIABLES(); \    if(_tmp_uid->swapped) { \    mt_lock_interpreter(); \    live_threads--; \    THREADS_FPRINTF(1, (stderr, \    "THREADS_DISALLOW_UID() %s:%d t:%08x(#%d)\n", \    __FILE__, __LINE__, \ -  (unsigned int)_tmp_uid->thread_id, live_threads)); \ +  (unsigned int)_tmp_uid->id, live_threads)); \    co_broadcast(&live_threads_change); \    while (threads_disabled) { \    THREADS_FPRINTF(1, (stderr, "THREADS_DISALLOW_UID(): Wait...\n")); \    co_wait_interpreter(&threads_disabled_change); \    } \    SWAP_IN_THREAD(_tmp_uid);\    } \    } while(0)      #define SWAP_IN_THREAD_IF_REQUIRED() do { \