Merge pull request #2003 from esdrubal/seq_test_fix2
[mono.git] / mono / io-layer / handles-private.h
index 5949b3a06bea3a6e3edc66808baa888754922fc9..c5d4fbeb70e94f400e7824cc1db1373a6f465094 100644 (file)
@@ -13,7 +13,6 @@
 #include <config.h>
 #include <glib.h>
 #include <errno.h>
-#include <signal.h>
 #include <string.h>
 #include <sys/types.h>
 
@@ -21,6 +20,7 @@
 #include <mono/io-layer/misc-private.h>
 #include <mono/io-layer/collection.h>
 #include <mono/io-layer/shared.h>
+#include <mono/utils/atomic.h>
 
 #define _WAPI_PRIVATE_MAX_SLOTS                (1024 * 16)
 #define _WAPI_PRIVATE_HANDLES(x) (_wapi_private_handles [x / _WAPI_HANDLE_INITIAL_COUNT][x % _WAPI_HANDLE_INITIAL_COUNT])
@@ -79,12 +79,9 @@ extern gboolean _wapi_handle_count_signalled_handles (guint32 numhandles,
                                                      guint32 *lowest);
 extern void _wapi_handle_unlock_handles (guint32 numhandles,
                                         gpointer *handles);
-extern int _wapi_handle_wait_signal (gboolean poll);
-extern int _wapi_handle_timedwait_signal (struct timespec *timeout, gboolean poll);
-extern int _wapi_handle_wait_signal_handle (gpointer handle, gboolean alertable);
-extern int _wapi_handle_timedwait_signal_handle (gpointer handle,
-                                                                                                struct timespec *timeout, gboolean alertable, gboolean poll);
-extern gboolean _wapi_handle_get_or_set_share (dev_t device, ino_t inode,
+extern int _wapi_handle_timedwait_signal (struct timespec *timeout, gboolean poll, gboolean *alerted);
+extern int _wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, gboolean alertable, gboolean poll, gboolean *alerted);
+extern gboolean _wapi_handle_get_or_set_share (guint64 device, guint64 inode,
                                               guint32 new_sharemode,
                                               guint32 new_access,
                                               guint32 *old_sharemode,
@@ -144,7 +141,6 @@ static inline void _wapi_handle_set_signal_state (gpointer handle,
                /* The condition the global signal cond is waiting on is the signalling of
                 * _any_ handle. So lock it before setting the signalled state.
                 */
-               pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup, (void *)_wapi_global_signal_mutex);
                thr_ret = mono_mutex_lock (_wapi_global_signal_mutex);
                if (thr_ret != 0)
                        g_warning ("Bad call to mono_mutex_lock result %d for global signal mutex", thr_ret);
@@ -179,8 +175,6 @@ static inline void _wapi_handle_set_signal_state (gpointer handle,
                if (thr_ret != 0)
                        g_warning ("Bad call to mono_mutex_unlock result %d for global signal mutex", thr_ret);
                g_assert (thr_ret == 0);
-
-               pthread_cleanup_pop (0);
        } else {
                handle_data->signalled=state;
        }