static volatile mword lowest_heap_address = ~(mword)0;
static volatile mword highest_heap_address = 0;
-LOCK_DECLARE (sgen_interruption_mutex);
+MonoCoopMutex sgen_interruption_mutex;
int current_collection_generation = -1;
static volatile gboolean concurrent_collection_in_progress = FALSE;
gc_debug_file = stderr;
- LOCK_INIT (sgen_interruption_mutex);
+ mono_coop_mutex_init (&sgen_interruption_mutex);
if ((env = g_getenv (MONO_GC_PARAMS_NAME))) {
opts = g_strsplit (env, ",", -1);
#include "mono/utils/mono-compiler.h"
#include "mono/utils/atomic.h"
#include "mono/utils/mono-os-mutex.h"
+#include "mono/utils/mono-coop-mutex.h"
#include "mono/sgen/sgen-conf.h"
#include "mono/sgen/sgen-hash-table.h"
#include "mono/sgen/sgen-protocol.h"
#define LOCK_GC do { sgen_gc_lock (); } while (0)
#define UNLOCK_GC do { sgen_gc_unlock (); } while (0)
-extern LOCK_DECLARE (sgen_interruption_mutex);
+extern MonoCoopMutex sgen_interruption_mutex;
-#define LOCK_INTERRUPTION do { \
- MONO_TRY_BLOCKING \
- mono_os_mutex_lock (&sgen_interruption_mutex); \
- MONO_FINISH_TRY_BLOCKING \
-} while (0)
-
-#define UNLOCK_INTERRUPTION mono_os_mutex_unlock (&sgen_interruption_mutex)
+#define LOCK_INTERRUPTION mono_coop_mutex_lock (&sgen_interruption_mutex)
+#define UNLOCK_INTERRUPTION mono_coop_mutex_unlock (&sgen_interruption_mutex)
/* FIXME: Use InterlockedAdd & InterlockedAdd64 to reduce the CAS cost. */
#define SGEN_CAS InterlockedCompareExchange