]> granicus.if.org Git - gc/commitdiff
NaCl GC improvements (fix volatile for vars accessed by syscall hooks)
authorElijah Taylor <elijahtaylor@google.com>
Thu, 31 Jan 2013 20:48:49 +0000 (12:48 -0800)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 2 Oct 2015 19:30:12 +0000 (22:30 +0300)
(Apply part of commit 204bcc6 from 'mono_libgc' branch.)

Conflicts:
* pthread_stop_world.c
* pthread_support.c

pthread_stop_world.c

index a9f3416558f96f9bcf32dee96345cfe461eeab58..0dfd356352f1bc24f83ac23a7ad3d1d7cbd92a9b 100644 (file)
 
 #ifdef NACL
 
-#include <unistd.h>
-#include <sys/time.h>
+# include <unistd.h>
+# include <sys/time.h>
 
-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)