[mono-threads] Split platform and suspend specific functions
[mono-project.git] / mono / utils / mono-threads-posix-abort-syscall.c
blob232161c273a23d6e01aaa1490206975c15039d56
1 /*
2 * mono-threads-posix-abort-syscall.c: Low-level syscall aborting
4 * Author:
5 * Ludovic Henry (ludovic@xamarin.com)
7 * (C) 2015 Xamarin, Inc
8 */
10 #include "config.h"
11 #include <glib.h>
13 #if defined (__MACH__)
14 #define _DARWIN_C_SOURCE 1
15 #endif
17 #include "mono-threads.h"
18 #include "mono-threads-posix-signals.h"
20 #if defined(USE_POSIX_BACKEND)
22 void
23 mono_threads_abort_syscall_init (void)
25 mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_ABORT);
28 void
29 mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
31 /* We signal a thread to break it from the current syscall.
32 * This signal should not be interpreted as a suspend request. */
33 info->syscall_break_signal = TRUE;
34 if (!mono_threads_pthread_kill (info, mono_threads_posix_get_abort_signal ()))
35 mono_threads_add_to_pending_operation_set (info);
38 gboolean
39 mono_threads_suspend_needs_abort_syscall (void)
41 return TRUE;
44 #endif