Merge pull request #2433 from alexrp/thread-volatile-semantics
[mono.git] / mono / io-layer / wapi-private.h
index 0c7899a3237982b0aa4a7409ed91e2c2242f1c5e..e01cdf6804cda195b9b55d6cd89a89f9d0e8c109 100644 (file)
 #include <glib.h>
 #include <sys/stat.h>
 
+#include <mono/io-layer/wapi.h>
 #include <mono/io-layer/handles.h>
 #include <mono/io-layer/io.h>
 
+#include <mono/utils/mono-os-mutex.h>
+
 /* Increment this whenever an incompatible change is made to the
  * shared handle structure.
  */
@@ -42,8 +45,7 @@ typedef enum {
 
 extern const char *_wapi_handle_typename[];
 
-#define _WAPI_SHARED_HANDLE(type) (type == WAPI_HANDLE_PROCESS || \
-                                  type == WAPI_HANDLE_NAMEDMUTEX || \
+#define _WAPI_SHARED_HANDLE(type) (type == WAPI_HANDLE_NAMEDMUTEX || \
                                   type == WAPI_HANDLE_NAMEDSEM || \
                                   type == WAPI_HANDLE_NAMEDEVENT)
 
@@ -92,7 +94,7 @@ struct _WapiHandleOps
         * instead of using the normal handle signal mechanism.
         * Returns the WaitForSingleObject return code.
         */
-       guint32 (*special_wait)(gpointer handle, guint32 timeout);
+       guint32 (*special_wait)(gpointer handle, guint32 timeout, gboolean alertable);
 
        /* Called by WaitForSingleObject and WaitForMultipleObjects,
         * if the handle in question needs some preprocessing before the
@@ -136,6 +138,7 @@ struct _WapiHandleUnshared
                struct _WapiHandle_sem sem;
                struct _WapiHandle_socket sock;
                struct _WapiHandle_thread thread;
+               struct _WapiHandle_process process;
                struct _WapiHandle_shared_ref shared;
        } u;
 };
@@ -149,7 +152,6 @@ struct _WapiHandleShared
        
        union
        {
-               struct _WapiHandle_process process;
                struct _WapiHandle_namedmutex namedmutex;
                struct _WapiHandle_namedsem namedsem;
                struct _WapiHandle_namedevent namedevent;
@@ -172,15 +174,15 @@ struct _WapiHandleSharedLayout
        struct _WapiHandleShared handles[_WAPI_HANDLE_INITIAL_COUNT];
 };
 
-#define _WAPI_FILESHARE_SIZE 102400
+typedef struct _WapiHandleSharedLayout _WapiHandleSharedLayout;
 
 struct _WapiFileShare
 {
 #ifdef WAPI_FILE_SHARE_PLATFORM_EXTRA_DATA
        WAPI_FILE_SHARE_PLATFORM_EXTRA_DATA
 #endif
-       dev_t device;
-       ino_t inode;
+       guint64 device;
+       guint64 inode;
        pid_t opened_by_pid;
        guint32 sharemode;
        guint32 access;
@@ -188,14 +190,7 @@ struct _WapiFileShare
        guint32 timestamp;
 };
 
-struct _WapiFileShareLayout
-{
-       guint32 hwm;
-       
-       struct _WapiFileShare share_info[_WAPI_FILESHARE_SIZE];
-};
-
-
+typedef struct _WapiFileShare _WapiFileShare;
 
 #define _WAPI_HANDLE_INVALID (gpointer)-1