X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=boehm-gc%2Firix_threads.c;h=12204fdabc2f606b5bfe541d900852427bb16ba2;hb=8f3c6510d5f1d2a0ebc711886314ad3b625c58f1;hp=101f5b1f412a7259205e4c770cb70176d762a5d7;hpb=f8c1da573b1b2b72501630f18fc1452e6b9e9c0c;p=pf3gnuchains%2Fgcc-fork.git diff --git a/boehm-gc/irix_threads.c b/boehm-gc/irix_threads.c index 101f5b1f412..12204fdabc2 100644 --- a/boehm-gc/irix_threads.c +++ b/boehm-gc/irix_threads.c @@ -21,11 +21,11 @@ * HP/UX 11. * * Note that there is a lot of code duplication between linux_threads.c - * and hpux_irix_threads.c; any changes made here may need to be reflected + * and irix_threads.c; any changes made here may need to be reflected * there too. */ -# if defined(GC_IRIX_THREADS) || defined(IRIX_THREADS) +# if defined(GC_IRIX_THREADS) # include "private/gc_priv.h" # include @@ -100,8 +100,8 @@ GC_thread GC_lookup_thread(pthread_t id); * The only way to suspend threads given the pthread interface is to send * signals. Unfortunately, this means we have to reserve * a signal, and intercept client calls to change the signal mask. + * We use SIG_SUSPEND, defined in gc_priv.h. */ -# define SIG_SUSPEND (SIGRTMIN + 6) pthread_mutex_t GC_suspend_lock = PTHREAD_MUTEX_INITIALIZER; /* Number of threads stopped so far */ @@ -141,8 +141,6 @@ GC_bool GC_thr_initialized = FALSE; size_t GC_min_stack_sz; -size_t GC_page_sz; - # define N_FREE_LISTS 25 ptr_t GC_stack_free_lists[N_FREE_LISTS] = { 0 }; /* GC_stack_free_lists[i] is free list for stacks of */ @@ -171,14 +169,14 @@ ptr_t GC_stack_alloc(size_t * stack_size) if (result != 0) { GC_stack_free_lists[index] = *(ptr_t *)result; } else { - result = (ptr_t) GC_scratch_alloc(search_sz + 2*GC_page_sz); - result = (ptr_t)(((word)result + GC_page_sz) & ~(GC_page_sz - 1)); + result = (ptr_t) GC_scratch_alloc(search_sz + 2*GC_page_size); + result = (ptr_t)(((word)result + GC_page_size) & ~(GC_page_size - 1)); /* Protect hottest page to detect overflow. */ # ifdef STACK_GROWS_UP - /* mprotect(result + search_sz, GC_page_sz, PROT_NONE); */ + /* mprotect(result + search_sz, GC_page_size, PROT_NONE); */ # else - /* mprotect(result, GC_page_sz, PROT_NONE); */ - result += GC_page_sz; + /* mprotect(result, GC_page_size, PROT_NONE); */ + result += GC_page_size; # endif } *stack_size = search_sz; @@ -438,7 +436,6 @@ void GC_thr_init() if (GC_thr_initialized) return; GC_thr_initialized = TRUE; GC_min_stack_sz = HBLKSIZE; - GC_page_sz = sysconf(_SC_PAGESIZE); (void) sigaction(SIG_SUSPEND, 0, &act); if (act.sa_handler != SIG_DFL) ABORT("Previously installed SIG_SUSPEND handler"); @@ -602,7 +599,7 @@ GC_pthread_create(pthread_t *new_thread, si -> start_routine = start_routine; si -> arg = arg; LOCK(); - if (!GC_thr_initialized) GC_thr_init(); + if (!GC_initialized) GC_init(); if (NULL == attr) { stack = 0; (void) pthread_attr_init(&new_attr); @@ -725,5 +722,5 @@ yield: int GC_no_Irix_threads; #endif -# endif /* IRIX_THREADS */ +# endif /* GC_IRIX_THREADS */