[threading] Make the GC lock coop suspend aware.
authorRodrigo Kumpera <kumpera@gmail.com>
Sun, 29 Mar 2015 00:46:09 +0000 (20:46 -0400)
committerRodrigo Kumpera <kumpera@gmail.com>
Sun, 29 Mar 2015 00:46:09 +0000 (20:46 -0400)
mono/metadata/sgen-gc.h

index 0c99daf3d21fe66847435019e2251fb181a4b3ca..a97cef02a7d15326a5b28130a100a65e00b7ab5d 100644 (file)
@@ -155,8 +155,10 @@ struct _GCMemSection {
    its use in mono_gc_base_init in sgen-gc.c */
 #define LOCK_INIT(name)        mono_mutex_init (&(name))
 #define LOCK_GC do {                                           \
+               MONO_PREPARE_BLOCKING   \
                mono_mutex_lock (&gc_mutex);                    \
                MONO_GC_LOCKED ();                              \
+               MONO_FINISH_BLOCKING    \
        } while (0)
 #define UNLOCK_GC do { sgen_gc_unlock (); } while (0)