~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to include/private/solaris_threads.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-19 12:19:56 UTC
  • mfrom: (1.3.2 upstream) (0.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110219121956-67rb69xlt5nud3v2
Tags: 1:7.1-5
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifdef GC_SOLARIS_THREADS
2
 
 
3
 
/* The set of all known threads.  We intercept thread creation and     */
4
 
/* joins.  We never actually create detached threads.  We allocate all */
5
 
/* new thread stacks ourselves.  These allow us to maintain this       */
6
 
/* data structure.                                                     */
7
 
/* Protected by GC_thr_lock.                                           */
8
 
/* Some of this should be declared volatile, but that's incosnsistent  */
9
 
/* with some library routine declarations.  In particular, the         */
10
 
/* definition of cond_t doesn't mention volatile!                      */
11
 
  typedef struct GC_Thread_Rep {
12
 
    struct GC_Thread_Rep * next;
13
 
    thread_t id;
14
 
    word flags;
15
 
#      define FINISHED 1       /* Thread has exited.   */
16
 
#      define DETACHED 2       /* Thread is intended to be detached.   */
17
 
#      define CLIENT_OWNS_STACK        4
18
 
                               /* Stack was supplied by client.        */
19
 
#      define SUSPNDED 8       /* Currently suspended.                  */
20
 
                               /* SUSPENDED is used insystem header.    */
21
 
    ptr_t stack;
22
 
    size_t stack_size;
23
 
    cond_t join_cv;
24
 
    void * status;
25
 
  } * GC_thread;
26
 
  extern GC_thread GC_new_thread(thread_t id);
27
 
 
28
 
  extern GC_bool GC_thr_initialized;
29
 
  extern volatile GC_thread GC_threads[];
30
 
  extern size_t GC_min_stack_sz;
31
 
  extern size_t GC_page_sz;
32
 
  extern void GC_thr_init(void);
33
 
  extern ptr_t GC_stack_alloc(size_t * stack_size);
34
 
  extern void GC_stack_free(ptr_t stack, size_t size);
35
 
 
36
 
# endif /* GC_SOLARIS_THREADS */
37