[jit] Avoid licm for volatile variables, ssa ignores them so we can't detect whenever...
[mono.git] / mono / io-layer / critical-sections.h
index a53ab288e3ff258a095a6b7fcadee6f0e65bb7f8..aa7bad248be58a1c2d255d99a110cf80c4595370 100644 (file)
@@ -13,7 +13,7 @@
 #include <glib.h>
 #include <pthread.h>
 
-#include "mono-mutex.h"
+#include <mono/utils/mono-mutex.h>
 
 G_BEGIN_DECLS
 
@@ -35,11 +35,15 @@ extern gboolean TryEnterCriticalSection(WapiCriticalSection *section);
 
 #define EnterCriticalSection(section) do { \
        int ret = mono_mutex_lock(&(section)->mutex);    \
-    g_assert (ret == 0);    \
+       if (ret != 0) \
+               g_warning ("Bad call to mono_mutex_lock result %d", ret); \
+       g_assert (ret == 0);                             \
 } while (0)
 
 #define LeaveCriticalSection(section) do { \
        int ret = mono_mutex_unlock(&(section)->mutex);      \
+       if (ret != 0) \
+               g_warning ("Bad call to mono_mutex_unlock result %d", ret); \
        g_assert (ret == 0);    \
 } while (0)