#include <config.h>
#include <glib.h>
+#include <pthread.h>
+#include <mono/utils/mono-semaphore.h>
-#include <mono/io-layer/timed-thread.h>
+/* There doesn't seem to be a defined symbol for this */
+#define _WAPI_THREAD_CURRENT (gpointer)0xFFFFFFFE
extern struct _WapiHandleOps _wapi_thread_ops;
-typedef enum {
- THREAD_STATE_START,
- THREAD_STATE_EXITED
-} WapiThreadState;
-
struct _WapiHandle_thread
{
- WapiThreadState state;
- guint32 exitstatus;
- pid_t owner_pid;
- TimedThread *thread;
- gboolean joined;
+ pthread_t id;
+ GPtrArray *owned_mutexes;
};
-extern gboolean _wapi_thread_apc_pending (gpointer handle);
-extern gboolean _wapi_thread_cur_apc_pending (void);
-extern gboolean _wapi_thread_dispatch_apc_queue (gpointer handle);
+typedef struct _WapiHandle_thread WapiHandle_thread;
+extern gboolean _wapi_thread_cur_apc_pending (void);
+extern void _wapi_thread_own_mutex (gpointer mutex);
+extern void _wapi_thread_disown_mutex (gpointer mutex);
+extern void _wapi_thread_cleanup (void);
#endif /* _WAPI_THREAD_PRIVATE_H_ */