#include <mono/io-layer/processes.h>
#include <mono/io-layer/access.h>
+G_BEGIN_DECLS
+
#define TLS_MINIMUM_AVAILABLE 64
#define TLS_OUT_OF_INDEXES 0xFFFFFFFF
typedef guint32 (*WapiThreadStart)(gpointer);
typedef guint32 (*WapiApcProc)(gpointer);
+/*
+ * The 'tid' argument has a different type than in win32, which breaks on win64.
+ * Runtime code shouldn't use this, use the mono_thread_create () function in
+ * metadata instead.
+ */
extern gpointer CreateThread(WapiSecurityAttributes *security,
guint32 stacksize, WapiThreadStart start,
- gpointer param, guint32 create, guint32 *tid);
-extern gpointer OpenThread (guint32 access, gboolean inherit, guint32 tid);
+ gpointer param, guint32 create, gsize *tid); /* NB tid is 32bit in MS API */
+extern gpointer OpenThread (guint32 access, gboolean inherit, gsize tid); /* NB tid is 32bit in MS API */
extern void ExitThread(guint32 exitcode) G_GNUC_NORETURN;
extern gboolean GetExitCodeThread(gpointer handle, guint32 *exitcode);
-extern guint32 GetCurrentThreadId(void);
+extern gsize GetCurrentThreadId(void); /* NB return is 32bit in MS API */
extern gpointer GetCurrentThread(void);
extern guint32 ResumeThread(gpointer handle);
extern guint32 SuspendThread(gpointer handle);
extern guint32 QueueUserAPC (WapiApcProc apc_callback, gpointer thread_handle,
gpointer param);
+/* Kludge alert! Making this visible outside io-layer is broken, but I
+ * can't find any w32 call that will let me do this.
+ */
+extern void _wapi_thread_signal_self (guint32 exitstatus);
+
+void wapi_interrupt_thread (gpointer handle);
+void wapi_clear_interruption (void);
+gboolean wapi_thread_set_wait_handle (gpointer handle);
+void wapi_thread_clear_wait_handle (gpointer handle);
+void wapi_self_interrupt (void);
+
+char* wapi_current_thread_desc (void);
+
+G_END_DECLS
#endif /* _WAPI_THREADS_H_ */