Merge pull request #3528 from BrzVlad/fix-sgen-check-before-collections
[mono.git] / mono / utils / mono-threads.h
index 6e74ec9fb8aa0ef95f5dbabcb429cc35dd680f24..5aafac7d7c28cad1ff71a1500dc066f03e945766 100644 (file)
@@ -221,11 +221,6 @@ typedef struct {
         */
        gboolean is_async_context;
 
-       gboolean create_suspended;
-
-       /* Semaphore used to implement CREATE_SUSPENDED */
-       MonoCoopSem create_suspended_sem;
-
        /*
         * Values of TLS variables for this thread.
         * This can be used to obtain the values of TLS variable for threads
@@ -246,6 +241,12 @@ typedef struct {
 
        /* Stack mark for targets that explicitly require one */
        gpointer stack_mark;
+
+#if defined(_POSIX_VERSION) || defined(__native_client__)
+       /* This is the data that was stored in the w32 handle */
+       GPtrArray *owned_mutexes;
+       gint32 priority;
+#endif
 } MonoThreadInfo;
 
 typedef struct {
@@ -416,7 +417,7 @@ mono_thread_info_is_async_context (void);
 void
 mono_thread_info_get_stack_bounds (guint8 **staddr, size_t *stsize);
 
-gboolean
+MONO_API gboolean
 mono_thread_info_yield (void);
 
 gint
@@ -434,9 +435,6 @@ mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value
 void
 mono_thread_info_exit (void);
 
-HANDLE
-mono_thread_info_open_handle (void);
-
 void
 mono_thread_info_set_exited (THREAD_INFO_TYPE *info);
 
@@ -476,6 +474,9 @@ mono_threads_get_max_stack_size (void);
 HANDLE
 mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
 
+void
+mono_threads_close_thread_handle (HANDLE handle);
+
 MONO_API void
 mono_threads_attach_tools_thread (void);
 
@@ -536,20 +537,20 @@ void mono_threads_suspend_free (THREAD_INFO_TYPE *info);
 void mono_threads_suspend_abort_syscall (THREAD_INFO_TYPE *info);
 gboolean mono_threads_suspend_needs_abort_syscall (void);
 
-HANDLE mono_threads_platform_create_thread (MonoThreadStart start, gpointer arg, MonoThreadParm *, MonoNativeThreadId *out_tid);
-void mono_threads_platform_resume_created (THREAD_INFO_TYPE *info, MonoNativeThreadId tid);
+void mono_threads_platform_register (THREAD_INFO_TYPE *info);
+void mono_threads_platform_unregister (THREAD_INFO_TYPE *info);
+int mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize stack_size, MonoNativeThreadId *out_tid);
 void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize);
 gboolean mono_threads_platform_yield (void);
 void mono_threads_platform_exit (int exit_code);
-void mono_threads_platform_unregister (THREAD_INFO_TYPE *info);
-HANDLE mono_threads_platform_open_handle (void);
 HANDLE mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
+void mono_threads_platform_close_thread_handle (HANDLE handle);
 void mono_threads_platform_set_exited (THREAD_INFO_TYPE *info);
 void mono_threads_platform_describe (THREAD_INFO_TYPE *info, GString *text);
 void mono_threads_platform_own_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
 void mono_threads_platform_disown_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
 MonoThreadPriority mono_threads_platform_get_priority (THREAD_INFO_TYPE *info);
-gboolean mono_threads_platform_set_priority (THREAD_INFO_TYPE *info, MonoThreadPriority priority);
+void mono_threads_platform_set_priority (THREAD_INFO_TYPE *info, MonoThreadPriority priority);
 
 void mono_threads_coop_begin_global_suspend (void);
 void mono_threads_coop_end_global_suspend (void);
@@ -679,7 +680,7 @@ mono_thread_info_disown_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
 MonoThreadPriority
 mono_thread_info_get_priority (THREAD_INFO_TYPE *info);
 
-gboolean
+void
 mono_thread_info_set_priority (THREAD_INFO_TYPE *info, MonoThreadPriority priority);
 
 #endif /* __MONO_THREADS_H__ */