Fix a warning.
[mono.git] / mono / mini / tasklets.c
index 9ab067a76b57cbd9ae0c4e67ebbff09c699df07d..28e7644d29cf3ab2f77cb4d1acd16e612f454dc2 100644 (file)
@@ -9,9 +9,9 @@
 
 /* keepalive_stacks could be a per-stack var to avoid locking overhead */
 static MonoGHashTable *keepalive_stacks;
-static CRITICAL_SECTION tasklets_mutex;
-#define tasklets_lock() EnterCriticalSection(&tasklets_mutex)
-#define tasklets_unlock() LeaveCriticalSection(&tasklets_mutex)
+static mono_mutex_t tasklets_mutex;
+#define tasklets_lock() mono_mutex_lock(&tasklets_mutex)
+#define tasklets_unlock() mono_mutex_unlock(&tasklets_mutex)
 
 /* LOCKING: tasklets_mutex is assumed to e taken */
 static void
@@ -146,7 +146,7 @@ continuation_restore (MonoContinuation *cont, int state)
 void
 mono_tasklets_init (void)
 {
-       InitializeCriticalSection (&tasklets_mutex);
+       mono_mutex_init_recursive (&tasklets_mutex);
 
        mono_add_internal_call ("Mono.Tasklets.Continuation::alloc", continuation_alloc);
        mono_add_internal_call ("Mono.Tasklets.Continuation::free", continuation_free);