From bd3e01a6ec1f8baf5e3db0195628e98927ba56e9 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 6 Jul 2016 15:08:06 +0200 Subject: [PATCH] [mono-threads] Split platform and suspend specific functions We split mono-threads-{posix,windows,mach}.c functions in 2 categories: - platform: depends on the host the runtime is compiled on (possible values: posix or windows) - suspend: depends on the mono-threads suspend backend in use (possible values: posix, windows or mach) --- mono/utils/mono-threads-android.c | 2 +- mono/utils/mono-threads-coop.c | 2 +- mono/utils/mono-threads-freebsd.c | 2 +- mono/utils/mono-threads-linux.c | 2 +- mono/utils/mono-threads-mach-abort-syscall.c | 12 ++++---- mono/utils/mono-threads-mach.c | 20 ++++++------- mono/utils/mono-threads-openbsd.c | 2 +- mono/utils/mono-threads-posix-abort-syscall.c | 6 ++-- mono/utils/mono-threads-posix.c | 30 +++++++++---------- mono/utils/mono-threads-windows-abort-syscall.c | 6 ++-- mono/utils/mono-threads-windows.c | 28 +++++++++--------- mono/utils/mono-threads.c | 38 ++++++++++++------------ mono/utils/mono-threads.h | 39 +++++++++++++------------ 13 files changed, 95 insertions(+), 94 deletions(-) diff --git a/mono/utils/mono-threads-android.c b/mono/utils/mono-threads-android.c index fa82387f26f..b5c03985766 100644 --- a/mono/utils/mono-threads-android.c +++ b/mono/utils/mono-threads-android.c @@ -37,7 +37,7 @@ slow_get_thread_bounds (guint8 *current, guint8 **staddr, size_t *stsize) } void -mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) +mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { pthread_attr_t attr; guint8 *current = (guint8*)&attr; diff --git a/mono/utils/mono-threads-coop.c b/mono/utils/mono-threads-coop.c index cd5d703a04a..9bfbdc51682 100644 --- a/mono/utils/mono-threads-coop.c +++ b/mono/utils/mono-threads-coop.c @@ -417,7 +417,7 @@ mono_threads_is_coop_enabled (void) void -mono_threads_init_coop (void) +mono_threads_coop_init (void) { if (!mono_threads_is_coop_enabled ()) return; diff --git a/mono/utils/mono-threads-freebsd.c b/mono/utils/mono-threads-freebsd.c index cdee0ab4061..e2e63555211 100644 --- a/mono/utils/mono-threads-freebsd.c +++ b/mono/utils/mono-threads-freebsd.c @@ -7,7 +7,7 @@ #include void -mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) +mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { pthread_attr_t attr; guint8 *current = (guint8*)&attr; diff --git a/mono/utils/mono-threads-linux.c b/mono/utils/mono-threads-linux.c index c5d6e8bab38..6ffec1ab604 100644 --- a/mono/utils/mono-threads-linux.c +++ b/mono/utils/mono-threads-linux.c @@ -6,7 +6,7 @@ #include void -mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) +mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { pthread_attr_t attr; diff --git a/mono/utils/mono-threads-mach-abort-syscall.c b/mono/utils/mono-threads-mach-abort-syscall.c index 559d2fa63c9..eb43625f479 100644 --- a/mono/utils/mono-threads-mach-abort-syscall.c +++ b/mono/utils/mono-threads-mach-abort-syscall.c @@ -21,18 +21,18 @@ #if defined(HOST_WATCHOS) || defined(HOST_TVOS) void -mono_threads_init_abort_syscall (void) +mono_threads_abort_syscall_init (void) { } void -mono_threads_core_abort_syscall (MonoThreadInfo *info) +mono_threads_suspend_abort_syscall (MonoThreadInfo *info) { } gboolean -mono_threads_core_needs_abort_syscall (void) +mono_threads_suspend_needs_abort_syscall (void) { return FALSE; } @@ -40,12 +40,12 @@ mono_threads_core_needs_abort_syscall (void) #else void -mono_threads_init_abort_syscall (void) +mono_threads_abort_syscall_init (void) { } void -mono_threads_core_abort_syscall (MonoThreadInfo *info) +mono_threads_suspend_abort_syscall (MonoThreadInfo *info) { kern_return_t ret; @@ -79,7 +79,7 @@ mono_threads_core_abort_syscall (MonoThreadInfo *info) } gboolean -mono_threads_core_needs_abort_syscall (void) +mono_threads_suspend_needs_abort_syscall (void) { return TRUE; } diff --git a/mono/utils/mono-threads-mach.c b/mono/utils/mono-threads-mach.c index b23680759a8..948804243cc 100644 --- a/mono/utils/mono-threads-mach.c +++ b/mono/utils/mono-threads-mach.c @@ -25,7 +25,7 @@ #include void -mono_threads_init_platform (void) +mono_threads_suspend_init (void) { mono_threads_init_dead_letter (); } @@ -33,19 +33,19 @@ mono_threads_init_platform (void) #if defined(HOST_WATCHOS) || defined(HOST_TVOS) gboolean -mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) +mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) { g_assert_not_reached (); } gboolean -mono_threads_core_check_suspend_result (MonoThreadInfo *info) +mono_threads_suspend_check_suspend_result (MonoThreadInfo *info) { g_assert_not_reached (); } gboolean -mono_threads_core_begin_async_resume (MonoThreadInfo *info) +mono_threads_suspend_begin_async_resume (MonoThreadInfo *info) { g_assert_not_reached (); } @@ -53,7 +53,7 @@ mono_threads_core_begin_async_resume (MonoThreadInfo *info) #else /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */ gboolean -mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) +mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) { kern_return_t ret; @@ -92,13 +92,13 @@ mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_ } gboolean -mono_threads_core_check_suspend_result (MonoThreadInfo *info) +mono_threads_suspend_check_suspend_result (MonoThreadInfo *info) { return info->suspend_can_continue; } gboolean -mono_threads_core_begin_async_resume (MonoThreadInfo *info) +mono_threads_suspend_begin_async_resume (MonoThreadInfo *info) { kern_return_t ret; @@ -148,7 +148,7 @@ mono_threads_core_begin_async_resume (MonoThreadInfo *info) #endif /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */ void -mono_threads_platform_register (MonoThreadInfo *info) +mono_threads_suspend_register (MonoThreadInfo *info) { char thread_name [64]; @@ -161,7 +161,7 @@ mono_threads_platform_register (MonoThreadInfo *info) } void -mono_threads_platform_free (MonoThreadInfo *info) +mono_threads_suspend_free (MonoThreadInfo *info) { mach_port_deallocate (current_task (), info->native_handle); } @@ -170,7 +170,7 @@ mono_threads_platform_free (MonoThreadInfo *info) #ifdef __MACH__ void -mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) +mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self()); *stsize = pthread_get_stacksize_np (pthread_self()); diff --git a/mono/utils/mono-threads-openbsd.c b/mono/utils/mono-threads-openbsd.c index 96a962230e1..7e2e0e21e2e 100644 --- a/mono/utils/mono-threads-openbsd.c +++ b/mono/utils/mono-threads-openbsd.c @@ -6,7 +6,7 @@ #include void -mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) +mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { /* TODO : Determine if this code is actually still needed. It may already be covered by the case above. */ pthread_attr_t attr; diff --git a/mono/utils/mono-threads-posix-abort-syscall.c b/mono/utils/mono-threads-posix-abort-syscall.c index 7e836163d67..232161c273a 100644 --- a/mono/utils/mono-threads-posix-abort-syscall.c +++ b/mono/utils/mono-threads-posix-abort-syscall.c @@ -20,13 +20,13 @@ #if defined(USE_POSIX_BACKEND) void -mono_threads_init_abort_syscall (void) +mono_threads_abort_syscall_init (void) { mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_ABORT); } void -mono_threads_core_abort_syscall (MonoThreadInfo *info) +mono_threads_suspend_abort_syscall (MonoThreadInfo *info) { /* We signal a thread to break it from the current syscall. * This signal should not be interpreted as a suspend request. */ @@ -36,7 +36,7 @@ mono_threads_core_abort_syscall (MonoThreadInfo *info) } gboolean -mono_threads_core_needs_abort_syscall (void) +mono_threads_suspend_needs_abort_syscall (void) { return TRUE; } diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c index cb218f5c14d..b12a87ab124 100644 --- a/mono/utils/mono-threads-posix.c +++ b/mono/utils/mono-threads-posix.c @@ -92,12 +92,12 @@ inner_start_thread (void *arg) /* Run the actual main function of the thread */ result = start_func (t_arg); - mono_threads_core_exit (GPOINTER_TO_UINT (result)); + mono_threads_platform_exit (GPOINTER_TO_UINT (result)); g_assert_not_reached (); } HANDLE -mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid) +mono_threads_platform_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid) { pthread_attr_t attr; int res; @@ -168,24 +168,24 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer } /* - * mono_threads_core_resume_created: + * mono_threads_platform_resume_created: * * Resume a newly created thread created using CREATE_SUSPENDED. */ void -mono_threads_core_resume_created (MonoThreadInfo *info, MonoNativeThreadId tid) +mono_threads_platform_resume_created (MonoThreadInfo *info, MonoNativeThreadId tid) { mono_coop_sem_post (&info->create_suspended_sem); } gboolean -mono_threads_core_yield (void) +mono_threads_platform_yield (void) { return sched_yield () == 0; } void -mono_threads_core_exit (int exit_code) +mono_threads_platform_exit (int exit_code) { MonoThreadInfo *current = mono_thread_info_current (); @@ -201,7 +201,7 @@ mono_threads_core_exit (int exit_code) } void -mono_threads_core_unregister (MonoThreadInfo *info) +mono_threads_platform_unregister (MonoThreadInfo *info) { if (info->handle) { wapi_thread_handle_set_exited (info->handle, 0); @@ -210,7 +210,7 @@ mono_threads_core_unregister (MonoThreadInfo *info) } HANDLE -mono_threads_core_open_handle (void) +mono_threads_platform_open_handle (void) { MonoThreadInfo *info; @@ -239,7 +239,7 @@ mono_threads_get_max_stack_size (void) } HANDLE -mono_threads_core_open_thread_handle (HANDLE handle, MonoNativeThreadId tid) +mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid) { wapi_ref_thread_handle (handle); @@ -339,7 +339,7 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name) #if defined(USE_POSIX_BACKEND) gboolean -mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) +mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) { int sig = interrupt_kernel ? mono_threads_posix_get_abort_signal () : mono_threads_posix_get_suspend_signal (); @@ -351,7 +351,7 @@ mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_ } gboolean -mono_threads_core_check_suspend_result (MonoThreadInfo *info) +mono_threads_suspend_check_suspend_result (MonoThreadInfo *info) { return info->suspend_can_continue; } @@ -363,14 +363,14 @@ This begins async resume. This function must do the following: - Notify the target to resume. */ gboolean -mono_threads_core_begin_async_resume (MonoThreadInfo *info) +mono_threads_suspend_begin_async_resume (MonoThreadInfo *info) { mono_threads_add_to_pending_operation_set (info); return mono_threads_pthread_kill (info, mono_threads_posix_get_restart_signal ()) == 0; } void -mono_threads_platform_register (MonoThreadInfo *info) +mono_threads_suspend_register (MonoThreadInfo *info) { #if defined (PLATFORM_ANDROID) info->native_handle = gettid (); @@ -378,12 +378,12 @@ mono_threads_platform_register (MonoThreadInfo *info) } void -mono_threads_platform_free (MonoThreadInfo *info) +mono_threads_suspend_free (MonoThreadInfo *info) { } void -mono_threads_init_platform (void) +mono_threads_suspend_init (void) { mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART); } diff --git a/mono/utils/mono-threads-windows-abort-syscall.c b/mono/utils/mono-threads-windows-abort-syscall.c index bf3cf242f65..19afe3e6b8e 100644 --- a/mono/utils/mono-threads-windows-abort-syscall.c +++ b/mono/utils/mono-threads-windows-abort-syscall.c @@ -17,7 +17,7 @@ #include void -mono_threads_init_abort_syscall (void) +mono_threads_abort_syscall_init (void) { } @@ -27,7 +27,7 @@ abort_apc (ULONG_PTR param) } void -mono_threads_core_abort_syscall (MonoThreadInfo *info) +mono_threads_suspend_abort_syscall (MonoThreadInfo *info) { DWORD id = mono_thread_info_get_tid (info); HANDLE handle; @@ -41,7 +41,7 @@ mono_threads_core_abort_syscall (MonoThreadInfo *info) } gboolean -mono_threads_core_needs_abort_syscall (void) +mono_threads_suspend_needs_abort_syscall (void) { return TRUE; } diff --git a/mono/utils/mono-threads-windows.c b/mono/utils/mono-threads-windows.c index c824cf314d0..c00a3155ca5 100644 --- a/mono/utils/mono-threads-windows.c +++ b/mono/utils/mono-threads-windows.c @@ -16,7 +16,7 @@ void -mono_threads_init_platform (void) +mono_threads_suspend_init (void) { } @@ -26,7 +26,7 @@ interrupt_apc (ULONG_PTR param) } gboolean -mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) +mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) { DWORD id = mono_thread_info_get_tid (info); HANDLE handle; @@ -67,13 +67,13 @@ mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_ } gboolean -mono_threads_core_check_suspend_result (MonoThreadInfo *info) +mono_threads_suspend_check_suspend_result (MonoThreadInfo *info) { return info->suspend_can_continue; } gboolean -mono_threads_core_begin_async_resume (MonoThreadInfo *info) +mono_threads_suspend_begin_async_resume (MonoThreadInfo *info) { DWORD id = mono_thread_info_get_tid (info); HANDLE handle; @@ -119,12 +119,12 @@ mono_threads_core_begin_async_resume (MonoThreadInfo *info) void -mono_threads_platform_register (MonoThreadInfo *info) +mono_threads_suspend_register (MonoThreadInfo *info) { } void -mono_threads_platform_free (MonoThreadInfo *info) +mono_threads_suspend_free (MonoThreadInfo *info) { } @@ -171,7 +171,7 @@ inner_start_thread (LPVOID arg) } HANDLE -mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid) +mono_threads_platform_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid) { ThreadStartInfo *start_info; HANDLE result; @@ -232,7 +232,7 @@ mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg) } void -mono_threads_core_resume_created (MonoThreadInfo *info, MonoNativeThreadId tid) +mono_threads_platform_resume_created (MonoThreadInfo *info, MonoNativeThreadId tid) { HANDLE handle; @@ -255,7 +255,7 @@ __readfsdword (unsigned long offset) #endif void -mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) +mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { MEMORY_BASIC_INFORMATION meminfo; #ifdef _WIN64 @@ -283,24 +283,24 @@ mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize) } gboolean -mono_threads_core_yield (void) +mono_threads_platform_yield (void) { return SwitchToThread (); } void -mono_threads_core_exit (int exit_code) +mono_threads_platform_exit (int exit_code) { ExitThread (exit_code); } void -mono_threads_core_unregister (MonoThreadInfo *info) +mono_threads_platform_unregister (MonoThreadInfo *info) { } HANDLE -mono_threads_core_open_handle (void) +mono_threads_platform_open_handle (void) { HANDLE thread_handle; @@ -325,7 +325,7 @@ mono_threads_get_max_stack_size (void) } HANDLE -mono_threads_core_open_thread_handle (HANDLE handle, MonoNativeThreadId tid) +mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid) { return OpenThread (THREAD_ALL_ACCESS, TRUE, tid); } diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index d9791d0764b..de2793aa4a6 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -118,7 +118,7 @@ begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel) return TRUE; } - return mono_threads_core_begin_async_suspend (info, interrupt_kernel); + return mono_threads_suspend_begin_async_suspend (info, interrupt_kernel); } static gboolean @@ -129,7 +129,7 @@ check_async_suspend (MonoThreadInfo *info) return TRUE; } - return mono_threads_core_check_suspend_result (info); + return mono_threads_suspend_check_suspend_result (info); } static void @@ -138,7 +138,7 @@ resume_async_suspended (MonoThreadInfo *info) if (mono_threads_is_coop_enabled ()) g_assert_not_reached (); - g_assert (mono_threads_core_begin_async_resume (info)); + g_assert (mono_threads_suspend_begin_async_resume (info)); } static void @@ -322,7 +322,7 @@ free_thread_info (gpointer mem) MonoThreadInfo *info = (MonoThreadInfo *) mem; mono_os_sem_destroy (&info->resume_semaphore); - mono_threads_platform_free (info); + mono_threads_suspend_free (info); g_free (info); } @@ -373,7 +373,7 @@ register_thread (MonoThreadInfo *info, gpointer baseptr) info->stackdata = g_byte_array_new (); - mono_threads_platform_register (info); + mono_threads_suspend_register (info); /* Transition it before taking any locks or publishing itself to reduce the chance @@ -413,7 +413,7 @@ unregister_thread (void *arg) mono_native_tls_set_value (thread_exited_key, GUINT_TO_POINTER (1)); - mono_threads_core_unregister (info); + mono_threads_platform_unregister (info); /* * TLS destruction order is not reliable so small_id might be cleaned up @@ -676,9 +676,9 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size) mono_lls_init (&thread_list, NULL, HAZARD_FREE_NO_LOCK); mono_thread_smr_init (); - mono_threads_init_platform (); - mono_threads_init_coop (); - mono_threads_init_abort_syscall (); + mono_threads_suspend_init (); + mono_threads_coop_init (); + mono_threads_abort_syscall_init (); #if defined(__MACH__) mono_mach_init (thread_info_key); @@ -752,7 +752,7 @@ mono_thread_info_core_resume (MonoThreadInfo *info) MonoNativeThreadId tid = mono_thread_info_get_tid (info); /* Have to special case this, as the normal suspend/resume pair are racy, they don't work if he resume is received before the suspend */ info->create_suspended = FALSE; - mono_threads_core_resume_created (info, tid); + mono_threads_platform_resume_created (info, tid); return TRUE; } @@ -906,7 +906,7 @@ suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel) break; case AsyncSuspendBlocking: if (interrupt_kernel) - mono_threads_core_abort_syscall (info); + mono_threads_suspend_abort_syscall (info); break; default: @@ -1062,7 +1062,7 @@ mono_thread_info_abort_socket_syscall_for_close (MonoNativeThreadId tid) MonoThreadHazardPointers *hp; MonoThreadInfo *info; - if (tid == mono_native_thread_id_get () || !mono_threads_core_needs_abort_syscall ()) + if (tid == mono_native_thread_id_get () || !mono_threads_suspend_needs_abort_syscall ()) return; hp = mono_hazard_pointer_get (); @@ -1078,7 +1078,7 @@ mono_thread_info_abort_socket_syscall_for_close (MonoNativeThreadId tid) mono_thread_info_suspend_lock (); mono_threads_begin_global_suspend (); - mono_threads_core_abort_syscall (info); + mono_threads_suspend_abort_syscall (info); mono_threads_wait_pending_operations (); mono_hazard_pointer_clear (hp, 1); @@ -1128,7 +1128,7 @@ mono_thread_info_is_async_context (void) HANDLE mono_threads_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid) { - return mono_threads_core_create_thread (start, arg, tp, out_tid); + return mono_threads_platform_create_thread (start, arg, tp, out_tid); } /* @@ -1141,7 +1141,7 @@ void mono_thread_info_get_stack_bounds (guint8 **staddr, size_t *stsize) { guint8 *current = (guint8 *)&stsize; - mono_threads_core_get_stack_bounds (staddr, stsize); + mono_threads_platform_get_stack_bounds (staddr, stsize); if (!*staddr) return; @@ -1155,7 +1155,7 @@ mono_thread_info_get_stack_bounds (guint8 **staddr, size_t *stsize) gboolean mono_thread_info_yield (void) { - return mono_threads_core_yield (); + return mono_threads_platform_yield (); } static mono_lazy_init_t sleep_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED; static MonoCoopMutex sleep_mutex; @@ -1329,7 +1329,7 @@ mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value void mono_thread_info_exit (void) { - mono_threads_core_exit (0); + mono_threads_platform_exit (0); } /* @@ -1342,7 +1342,7 @@ mono_thread_info_exit (void) HANDLE mono_thread_info_open_handle (void) { - return mono_threads_core_open_handle (); + return mono_threads_platform_open_handle (); } /* @@ -1355,7 +1355,7 @@ mono_thread_info_open_handle (void) HANDLE mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid) { - return mono_threads_core_open_thread_handle (handle, tid); + return mono_threads_platform_open_thread_handle (handle, tid); } #define INTERRUPT_STATE ((MonoThreadInfoInterruptToken*) (size_t) -1) diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index eaab83591e5..e6b6e4746ef 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -480,11 +480,11 @@ mono_threads_pthread_kill (THREAD_INFO_TYPE *info, int signum); This is called very early in the runtime, it cannot access any runtime facilities. */ -void mono_threads_init_platform (void); //ok +void mono_threads_suspend_init (void); //ok -void mono_threads_init_coop (void); +void mono_threads_coop_init (void); -void mono_threads_init_abort_syscall (void); +void mono_threads_abort_syscall_init (void); /* This begins async suspend. This function must do the following: @@ -495,7 +495,7 @@ This begins async suspend. This function must do the following: If begin suspend fails the thread must be left uninterrupted and resumed. */ -gboolean mono_threads_core_begin_async_suspend (THREAD_INFO_TYPE *info, gboolean interrupt_kernel); +gboolean mono_threads_suspend_begin_async_suspend (THREAD_INFO_TYPE *info, gboolean interrupt_kernel); /* This verifies the outcome of an async suspend operation. @@ -503,7 +503,7 @@ This verifies the outcome of an async suspend operation. Some targets, such as posix, verify suspend results assynchronously. Suspend results must be available (in a non blocking way) after mono_threads_wait_pending_operations completes. */ -gboolean mono_threads_core_check_suspend_result (THREAD_INFO_TYPE *info); +gboolean mono_threads_suspend_check_suspend_result (THREAD_INFO_TYPE *info); /* This begins async resume. This function must do the following: @@ -512,20 +512,21 @@ This begins async resume. This function must do the following: - Notify the target to resume. - Register the thread for pending ack with mono_threads_add_to_pending_operation_set if needed. */ -gboolean mono_threads_core_begin_async_resume (THREAD_INFO_TYPE *info); - -void mono_threads_platform_register (THREAD_INFO_TYPE *info); //ok -void mono_threads_platform_free (THREAD_INFO_TYPE *info); -void mono_threads_core_abort_syscall (THREAD_INFO_TYPE *info); -gboolean mono_threads_core_needs_abort_syscall (void); -HANDLE mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, MonoThreadParm *, MonoNativeThreadId *out_tid); -void mono_threads_core_resume_created (THREAD_INFO_TYPE *info, MonoNativeThreadId tid); -void mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize); -gboolean mono_threads_core_yield (void); -void mono_threads_core_exit (int exit_code); -void mono_threads_core_unregister (THREAD_INFO_TYPE *info); -HANDLE mono_threads_core_open_handle (void); -HANDLE mono_threads_core_open_thread_handle (HANDLE handle, MonoNativeThreadId tid); +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); + +HANDLE mono_threads_platform_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, MonoThreadParm *, MonoNativeThreadId *out_tid); +void mono_threads_platform_resume_created (THREAD_INFO_TYPE *info, MonoNativeThreadId 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_coop_begin_global_suspend (void); void mono_threads_coop_end_global_suspend (void); -- 2.11.4.GIT