Back to index

lightning-sunbird  0.9+nobinonly
solaris_threads.h
Go to the documentation of this file.
00001 #ifdef SOLARIS_THREADS
00002 
00003 /* The set of all known threads.  We intercept thread creation and     */
00004 /* joins.  We never actually create detached threads.  We allocate all */
00005 /* new thread stacks ourselves.  These allow us to maintain this       */
00006 /* data structure.                                                     */
00007 /* Protected by GC_thr_lock.                                           */
00008 /* Some of this should be declared volatile, but that's incosnsistent  */
00009 /* with some library routine declarations.  In particular, the               */
00010 /* definition of cond_t doesn't mention volatile!                      */
00011   typedef struct GC_Thread_Rep {
00012     struct GC_Thread_Rep * next;
00013     thread_t id;
00014     word flags;
00015 #      define FINISHED 1       /* Thread has exited.   */
00016 #      define DETACHED 2       /* Thread is intended to be detached.   */
00017 #      define CLIENT_OWNS_STACK        4
00018                                /* Stack was supplied by client.        */
00019 #      define SUSPENDED 8      /* Currently suspended. */
00020     ptr_t stack;
00021     size_t stack_size;
00022     cond_t join_cv;
00023     void * status;
00024   } * GC_thread;
00025   extern GC_thread GC_new_thread(thread_t id);
00026 
00027   extern GC_bool GC_thr_initialized;
00028   extern volatile GC_thread GC_threads[];
00029   extern size_t GC_min_stack_sz;
00030   extern size_t GC_page_sz;
00031   extern void GC_thr_init(void);
00032 
00033 # endif /* SOLARIS_THREADS */
00034