From: Elijah Taylor Date: Thu, 31 Jan 2013 20:48:49 +0000 (-0800) Subject: NaCl GC improvements (fix volatile for vars accessed by syscall hooks) X-Git-Tag: gc7_6_0~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0db6025887ea1b9c8714e3908ae0510e99f447ac;p=gc NaCl GC improvements (fix volatile for vars accessed by syscall hooks) (Apply part of commit 204bcc6 from 'mono_libgc' branch.) Conflicts: * pthread_stop_world.c * pthread_support.c --- diff --git a/pthread_stop_world.c b/pthread_stop_world.c index a9f34165..0dfd3563 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -22,18 +22,18 @@ #ifdef NACL -#include -#include +# include +# include -STATIC int GC_nacl_num_gc_threads = 0; -STATIC __thread int GC_nacl_thread_idx = -1; -STATIC int GC_nacl_park_threads_now = 0; -STATIC pthread_t GC_nacl_thread_parker = -1; + STATIC int GC_nacl_num_gc_threads = 0; + STATIC __thread int GC_nacl_thread_idx = -1; + STATIC volatile int GC_nacl_park_threads_now = 0; + STATIC volatile pthread_t GC_nacl_thread_parker = -1; -GC_INNER __thread GC_thread GC_nacl_gc_thread_self = NULL; + GC_INNER __thread GC_thread GC_nacl_gc_thread_self = NULL; -int GC_nacl_thread_parked[MAX_NACL_GC_THREADS]; -int GC_nacl_thread_used[MAX_NACL_GC_THREADS]; + volatile int GC_nacl_thread_parked[MAX_NACL_GC_THREADS]; + int GC_nacl_thread_used[MAX_NACL_GC_THREADS]; #elif defined(GC_OPENBSD_UTHREADS)