[llvm] Fix the loadable llvm build.
[mono.git] / mono / io-layer / events.c
index 5c072aafd9ef1603b820fe03904df144d29a3363..ac8068d41a472696b34584307a22d514cfe4f6b8 100644 (file)
 #include <mono/io-layer/handles-private.h>
 #include <mono/io-layer/misc-private.h>
 
-#include <mono/io-layer/mono-mutex.h>
-
 #include <mono/io-layer/event-private.h>
 
+#include <mono/utils/mono-mutex.h>
 #if 0
 #define DEBUG(...) g_message(__VA_ARGS__)
 #else
@@ -191,8 +190,6 @@ static gpointer event_create (WapiSecurityAttributes *security G_GNUC_UNUSED,
                return(NULL);
        }
 
-       pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
-                             handle);
        thr_ret = _wapi_handle_lock_handle (handle);
        g_assert (thr_ret == 0);
        
@@ -204,7 +201,6 @@ static gpointer event_create (WapiSecurityAttributes *security G_GNUC_UNUSED,
 
        thr_ret = _wapi_handle_unlock_handle (handle);
        g_assert (thr_ret == 0);
-       pthread_cleanup_pop (0);
 
        return(handle);
 }
@@ -365,8 +361,6 @@ static gboolean event_pulse (gpointer handle)
                return(FALSE);
        }
        
-       pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
-                             handle);
        thr_ret = _wapi_handle_lock_handle (handle);
        g_assert (thr_ret == 0);
 
@@ -382,8 +376,6 @@ static gboolean event_pulse (gpointer handle)
        thr_ret = _wapi_handle_unlock_handle (handle);
        g_assert (thr_ret == 0);
        
-       pthread_cleanup_pop (0);
-       
        if (event_handle->manual == TRUE) {
                /* For a manual-reset event, we're about to try and
                 * get the handle lock again, so give other threads a
@@ -400,7 +392,6 @@ static gboolean event_pulse (gpointer handle)
                DEBUG ("%s: Obtained write lock on event handle %p",
                           __func__, handle);
 
-               pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle, handle);
                thr_ret = _wapi_handle_lock_handle (handle);
                g_assert (thr_ret == 0);
                
@@ -408,7 +399,6 @@ static gboolean event_pulse (gpointer handle)
 
                thr_ret = _wapi_handle_unlock_handle (handle);
                g_assert (thr_ret == 0);
-               pthread_cleanup_pop (0);
        }
 
        return(TRUE);
@@ -519,8 +509,6 @@ static gboolean event_reset (gpointer handle)
 
        DEBUG ("%s: Resetting event handle %p", __func__, handle);
 
-       pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
-                             handle);
        thr_ret = _wapi_handle_lock_handle (handle);
        g_assert (thr_ret == 0);
        
@@ -539,8 +527,6 @@ static gboolean event_reset (gpointer handle)
        thr_ret = _wapi_handle_unlock_handle (handle);
        g_assert (thr_ret == 0);
        
-       pthread_cleanup_pop (0);
-       
        return(TRUE);
 }
 
@@ -622,8 +608,6 @@ static gboolean event_set (gpointer handle)
                return(FALSE);
        }
        
-       pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
-                             handle);
        thr_ret = _wapi_handle_lock_handle (handle);
        g_assert (thr_ret == 0);
 
@@ -639,8 +623,6 @@ static gboolean event_set (gpointer handle)
        thr_ret = _wapi_handle_unlock_handle (handle);
        g_assert (thr_ret == 0);
        
-       pthread_cleanup_pop (0);
-
        return(TRUE);
 }