column name and ordinal fix...tested on 10.1
[mono.git] / mono / utils / w32handle.h
index 4e2c27c6cb70b45e3de5a2e803d823b41c7a2f1c..de65da19e9fb9c106f45097e5a1ff1ebf6042cf3 100644 (file)
@@ -3,12 +3,13 @@
 #define _MONO_UTILS_W32HANDLE_H_
 
 #include <config.h>
-
-#if !defined(HOST_WIN32)
-
 #include <glib.h>
 
+#ifndef INVALID_HANDLE_VALUE
 #define INVALID_HANDLE_VALUE (gpointer)-1
+#endif
+
+#define MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS 64
 
 typedef enum {
        MONO_W32HANDLE_UNUSED = 0,
@@ -38,8 +39,10 @@ typedef struct
        /* Called by WaitForSingleObject and WaitForMultipleObjects,
         * with the handle locked (shared handles aren't locked.)
         * Returns TRUE if ownership was established, false otherwise.
+        * If TRUE, *statuscode contains a status code such as
+        * WAIT_OBJECT_0 or WAIT_ABANDONED_0.
         */
-       gboolean (*own_handle)(gpointer handle);
+       gboolean (*own_handle)(gpointer handle, guint32 *statuscode);
 
        /* Called by WaitForSingleObject and WaitForMultipleObjects, if the
         * handle in question is "ownable" (ie mutexes), to see if the current
@@ -52,7 +55,7 @@ typedef struct
         * instead of using the normal handle signal mechanism.
         * Returns the WaitForSingleObject return code.
         */
-       guint32 (*special_wait)(gpointer handle, guint32 timeout, gboolean alertable);
+       guint32 (*special_wait)(gpointer handle, guint32 timeout, gboolean *alerted);
 
        /* Called by WaitForSingleObject and WaitForMultipleObjects,
         * if the handle in question needs some preprocessing before the
@@ -128,13 +131,13 @@ void
 mono_w32handle_ops_signal (gpointer handle);
 
 gboolean
-mono_w32handle_ops_own (gpointer handle);
+mono_w32handle_ops_own (gpointer handle, guint32 *statuscode);
 
 gboolean
 mono_w32handle_ops_isowned (gpointer handle);
 
 guint32
-mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean alertable);
+mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean *alerted);
 
 void
 mono_w32handle_ops_prewait (gpointer handle);
@@ -148,18 +151,6 @@ mono_w32handle_ops_typename (MonoW32HandleType type);
 gsize
 mono_w32handle_ops_typesize (MonoW32HandleType type);
 
-gboolean
-mono_w32handle_count_signalled_handles (guint32 numhandles, gpointer *handles, gboolean waitall, guint32 *retcount, guint32 *lowest);
-
-void
-mono_w32handle_unlock_handles (guint32 numhandles, gpointer *handles);
-
-int
-mono_w32handle_timedwait_signal_handle (gpointer handle, guint32 timeout, gboolean poll, gboolean *alerted);
-
-int
-mono_w32handle_timedwait_signal (guint32 timeout, gboolean poll, gboolean *alerted);
-
 void
 mono_w32handle_set_signal_state (gpointer handle, gboolean state, gboolean broadcast);
 
@@ -175,12 +166,21 @@ mono_w32handle_trylock_handle (gpointer handle);
 int
 mono_w32handle_unlock_handle (gpointer handle);
 
-int
-mono_w32handle_lock_signal_mutex (void);
+typedef enum {
+       MONO_W32HANDLE_WAIT_RET_SUCCESS_0   =  0,
+       MONO_W32HANDLE_WAIT_RET_ABANDONED_0 =  MONO_W32HANDLE_WAIT_RET_SUCCESS_0 + MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS,
+       MONO_W32HANDLE_WAIT_RET_ALERTED     = -1,
+       MONO_W32HANDLE_WAIT_RET_TIMEOUT     = -2,
+       MONO_W32HANDLE_WAIT_RET_FAILED      = -3,
+} MonoW32HandleWaitRet;
 
-int
-mono_w32handle_unlock_signal_mutex (void);
+MonoW32HandleWaitRet
+mono_w32handle_wait_one (gpointer handle, guint32 timeout, gboolean alertable);
+
+MonoW32HandleWaitRet
+mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waitall, guint32 timeout, gboolean alertable);
 
-#endif /* !defined(HOST_WIN32) */
+MonoW32HandleWaitRet
+mono_w32handle_signal_and_wait (gpointer signal_handle, gpointer wait_handle, guint32 timeout, gboolean alertable);
 
 #endif /* _MONO_UTILS_W32HANDLE_H_ */