2003-04-24 Martin Baulig <martin@ximian.com>
[mono.git] / mono / metadata / threads-types.h
index aac7d5f26c4178a7bb9e158b3bd5e97a023224fd..3ce6f3800c7cc12bf25e5d84f800335fb57a3338 100644 (file)
 #ifndef _MONO_METADATA_THREADS_TYPES_H_
 #define _MONO_METADATA_THREADS_TYPES_H_
 
-
-#include <config.h>
+#include <glib.h>
 
 #include <mono/io-layer/io-layer.h>
 
-/*
- * This is bonkers. We are emulating condition variables here using
- * win32 calls, which on Linux are being emulated with condition
- * variables :-)
- *
- * See http://www.cs.wustl.edu/~schmidt/win32-cv-1.html for the design.
- */
-
-typedef struct 
+typedef struct
 {
-       HANDLE monitor;
-       guint32 tid;
-
-       /* Need to count how many times this monitor object has been
-        * locked by the owning thread, so that we can unlock it
-        * completely in Wait()
-        */
-       guint32 count;
-
-       /* condition variable management */
-       guint32 waiters_count;
-       CRITICAL_SECTION waiters_count_lock;
-       HANDLE sema;
-       HANDLE waiters_done;
-       gboolean was_broadcast;
+       guint32 owner;                  /* thread ID */
+       guint32 nest;
+       volatile guint32 entry_count;
+       HANDLE entry_sem;
+       GSList *wait_list;
 } MonoThreadsSync;
 
 #endif /* _MONO_METADATA_THREADS_TYPES_H_ */