[threads] Remove mono_threads_suspend_needs_abort_syscall (#4450)
[mono.git] / mono / utils / mono-threads.h
index ed8285f136778d003286c000e846eae610399935..f0410e3132e0ae0cd8a96e1ef47d3a5a7f060263 100644 (file)
@@ -16,8 +16,7 @@
 #include <mono/utils/mono-tls.h>
 #include <mono/utils/mono-coop-semaphore.h>
 #include <mono/utils/os-event.h>
-
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/refcount.h>
 
 #include <glib.h>
 #include <config.h>
@@ -63,10 +62,18 @@ typedef gsize mono_thread_start_return_t;
 
 typedef gsize (*MonoThreadStart)(gpointer);
 
+#if !defined(__HAIKU__)
+#define MONO_THREADS_PLATFORM_HAS_ATTR_SETSCHED
+#endif /* !defined(__HAIKU__) */
+
 #endif /* #ifdef HOST_WIN32 */
 
+#ifndef MONO_INFINITE_WAIT
+#define MONO_INFINITE_WAIT ((guint32) 0xFFFFFFFF)
+#endif
+
 typedef struct {
-       guint32 ref;
+       MonoRefCount ref;
        MonoOSEvent event;
 } MonoThreadHandle;
 
@@ -293,6 +300,9 @@ mono_thread_info_set_tid (THREAD_INFO_TYPE *info, MonoNativeThreadId tid)
 void
 mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t thread_info_size);
 
+void
+mono_threads_signals_init (void);
+
 void
 mono_threads_runtime_init (MonoThreadInfoRuntimeCallbacks *callbacks);
 
@@ -332,15 +342,6 @@ mono_thread_info_resume (MonoNativeThreadId tid);
 void
 mono_thread_info_safe_suspend_and_run (MonoNativeThreadId id, gboolean interrupt_kernel, MonoSuspendThreadCallback callback, gpointer user_data);
 
-//XXX new API, fix the world
-void
-mono_thread_info_begin_self_suspend (void);
-
-void
-mono_thread_info_end_self_suspend (void);
-
-//END of new API
-
 void
 mono_thread_info_setup_async_call (THREAD_INFO_TYPE *info, void (*target_func)(void*), void *user_data);
 
@@ -475,14 +476,18 @@ gboolean mono_threads_suspend_begin_async_resume (THREAD_INFO_TYPE *info);
 void mono_threads_suspend_register (THREAD_INFO_TYPE *info); //ok
 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);
 gint mono_threads_suspend_search_alternative_signal (void);
 gint mono_threads_suspend_get_suspend_signal (void);
 gint mono_threads_suspend_get_restart_signal (void);
 gint mono_threads_suspend_get_abort_signal (void);
 
+#if defined(USE_POSIX_BACKEND)
+void mono_threads_platform_reset_priority (pthread_attr_t *attr);
+#endif /* defined(USE_POSIX_BACKEND) */
 int mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize* const stack_size, MonoNativeThreadId *out_tid);
 void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize);
+void mono_threads_platform_init (void);
+gboolean mono_threads_platform_in_critical_region (MonoNativeThreadId tid);
 gboolean mono_threads_platform_yield (void);
 void mono_threads_platform_exit (gsize exit_code);
 
@@ -567,7 +572,6 @@ typedef enum {
 
 void mono_threads_transition_attach (THREAD_INFO_TYPE* info);
 gboolean mono_threads_transition_detach (THREAD_INFO_TYPE *info);
-void mono_threads_transition_request_self_suspension (THREAD_INFO_TYPE *info);
 MonoRequestAsyncSuspendResult mono_threads_transition_request_async_suspension (THREAD_INFO_TYPE *info);
 MonoSelfSupendResult mono_threads_transition_state_poll (THREAD_INFO_TYPE *info);
 MonoResumeResult mono_threads_transition_request_resume (THREAD_INFO_TYPE* info);
@@ -615,4 +619,7 @@ mono_thread_info_wait_one_handle (MonoThreadHandle *handle, guint32 timeout, gbo
 MonoThreadInfoWaitRet
 mono_thread_info_wait_multiple_handle (MonoThreadHandle **thread_handles, gsize nhandles, MonoOSEvent *background_change_event, gboolean waitall, guint32 timeout, gboolean alertable);
 
+void mono_threads_join_lock (void);
+void mono_threads_join_unlock (void);
+
 #endif /* __MONO_THREADS_H__ */