Back to index

plt-scheme  4.2.1
solaris_threads.h
Go to the documentation of this file.
00001 #ifdef GC_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 SUSPNDED 8       /* Currently suspended.                */
00020                             /* SUSPENDED is used insystem header.     */
00021     ptr_t stack;
00022     size_t stack_size;
00023     cond_t join_cv;
00024     void * status;
00025   } * GC_thread;
00026   extern GC_thread GC_new_thread(thread_t id);
00027 
00028   extern GC_bool GC_thr_initialized;
00029   extern volatile GC_thread GC_threads[];
00030   extern size_t GC_min_stack_sz;
00031   extern size_t GC_page_sz;
00032   extern void GC_thr_init(void);
00033   extern ptr_t GC_stack_alloc(size_t * stack_size);
00034   extern void GC_stack_free(ptr_t stack, size_t size);
00035 
00036 # endif /* GC_SOLARIS_THREADS */
00037