[BACK]Return to gc_pthread_redirects.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / gc / include

Annotation of OpenXM_contrib2/asir2000/gc/include/gc_pthread_redirects.h, Revision 1.4

1.1       noro        1: /* Our pthread support normally needs to intercept a number of thread  */
                      2: /* calls.  We arrange to do that here, if appropriate.                 */
                      3:
                      4: #ifndef GC_PTHREAD_REDIRECTS_H
                      5:
                      6: #define GC_PTHREAD_REDIRECTS_H
                      7:
                      8: #if defined(GC_SOLARIS_THREADS)
                      9: /* We need to intercept calls to many of the threads primitives, so    */
                     10: /* that we can locate thread stacks and stop the world.                        */
                     11: /* Note also that the collector cannot see thread specific data.       */
                     12: /* Thread specific data should generally consist of pointers to                */
                     13: /* uncollectable objects (allocated with GC_malloc_uncollectable,      */
                     14: /* not the system malloc), which are deallocated using the destructor  */
                     15: /* facility in thr_keycreate.  Alternatively, keep a redundant pointer */
                     16: /* to thread specific data on the thread stack.                                */
                     17: # include <thread.h>
                     18:   int GC_thr_create(void *stack_base, size_t stack_size,
                     19:                     void *(*start_routine)(void *), void *arg, long flags,
                     20:                     thread_t *new_thread);
                     21:   int GC_thr_join(thread_t wait_for, thread_t *departed, void **status);
                     22:   int GC_thr_suspend(thread_t target_thread);
                     23:   int GC_thr_continue(thread_t target_thread);
                     24:   void * GC_dlopen(const char *path, int mode);
                     25: # define thr_create GC_thr_create
                     26: # define thr_join GC_thr_join
                     27: # define thr_suspend GC_thr_suspend
                     28: # define thr_continue GC_thr_continue
                     29: #endif /* GC_SOLARIS_THREADS */
                     30:
                     31: #if defined(GC_SOLARIS_PTHREADS)
                     32: # include <pthread.h>
                     33: # include <signal.h>
                     34:   extern int GC_pthread_create(pthread_t *new_thread,
                     35:                                 const pthread_attr_t *attr,
                     36:                                 void * (*thread_execp)(void *), void *arg);
                     37:   extern int GC_pthread_join(pthread_t wait_for, void **status);
                     38: # define pthread_join GC_pthread_join
                     39: # define pthread_create GC_pthread_create
                     40: #endif
                     41:
                     42: #if defined(GC_SOLARIS_PTHREADS) || defined(GC_SOLARIS_THREADS)
                     43: # define dlopen GC_dlopen
                     44: #endif /* SOLARIS_THREADS || SOLARIS_PTHREADS */
                     45:
                     46:
1.3       noro       47: #if !defined(GC_USE_LD_WRAP) && defined(GC_PTHREADS) && !defined(GC_SOLARIS_PTHREADS)
1.1       noro       48: /* We treat these similarly. */
                     49: # include <pthread.h>
                     50: # include <signal.h>
                     51:
                     52:   int GC_pthread_create(pthread_t *new_thread,
                     53:                         const pthread_attr_t *attr,
                     54:                        void *(*start_routine)(void *), void *arg);
1.4     ! noro       55: #ifndef GC_DARWIN_THREADS
1.1       noro       56:   int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
1.4     ! noro       57: #endif
1.1       noro       58:   int GC_pthread_join(pthread_t thread, void **retval);
                     59:   int GC_pthread_detach(pthread_t thread);
                     60:
                     61: # define pthread_create GC_pthread_create
1.4     ! noro       62: #ifndef GC_DARWIN_THREADS
1.1       noro       63: # define pthread_sigmask GC_pthread_sigmask
1.4     ! noro       64: #endif
1.1       noro       65: # define pthread_join GC_pthread_join
                     66: # define pthread_detach GC_pthread_detach
1.4     ! noro       67: #ifndef GC_DARWIN_THREADS
1.1       noro       68: # define dlopen GC_dlopen
1.4     ! noro       69: #endif
1.1       noro       70:
                     71: #endif /* GC_xxxxx_THREADS */
                     72:
                     73: #endif /* GC_PTHREAD_REDIRECTS_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>