ASYNC_SUSPEND_STATE_INDEX = 1,
};
-/*
- * This enum tells which async thread service corresponds to which bit.
- */
-typedef enum {
- MONO_SERVICE_REQUEST_SAMPLE = 1,
-} MonoAsyncJob;
-
typedef struct _MonoThreadInfoInterruptToken MonoThreadInfoInterruptToken;
typedef struct {
#if defined(USE_POSIX_BACKEND)
MonoSemType finish_resume_semaphore;
gboolean syscall_break_signal;
- gboolean suspend_can_continue;
int signal;
#endif
+ gboolean suspend_can_continue;
+
/* This memory pool is used by coop GC to save stack data roots between GC unsafe regions */
GByteArray *stackdata;
/* Set when the thread is started, or in _wapi_thread_duplicate () */
HANDLE handle;
- /* Asynchronous service request. This flag is meant to be consumed by the multiplexing signal handlers to discover what sort of work they need to do.
- * Use the mono_threads_add_async_job and mono_threads_consume_async_jobs APIs to modify this flag.
- * In the future the signaling should be part of the API, but for now, it's only for massaging the bits.
- */
- volatile gint32 service_requests;
-
void *jit_data;
MonoThreadInfoInterruptToken *interrupt_token;
THREAD_INFO_TYPE *
mono_thread_info_attach (void *baseptr);
-void
+MONO_API void
mono_thread_info_detach (void);
gboolean
gboolean
mono_thread_info_resume (MonoNativeThreadId tid);
-void
-mono_thread_info_set_name (MonoNativeThreadId tid, const char *name);
-
void
mono_thread_info_safe_suspend_and_run (MonoNativeThreadId id, gboolean interrupt_kernel, MonoSuspendThreadCallback callback, gpointer user_data);
HANDLE
mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
-/*
-This is the async job submission/consumption API.
-XXX: This is a PROVISIONAL API only meant to be used by the statistical profiler.
-If you want to use/extend it anywhere else, understand that you'll have to do some API design work to better fit this puppy.
-*/
-gboolean
-mono_threads_add_async_job (THREAD_INFO_TYPE *info, MonoAsyncJob job);
-
-MonoAsyncJob
-mono_threads_consume_async_jobs (void);
-
MONO_API void
mono_threads_attach_tools_thread (void);
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);
-void mono_threads_core_set_name (MonoNativeThreadId tid, const char *name);
void mono_threads_coop_begin_global_suspend (void);
void mono_threads_coop_end_global_suspend (void);
-MonoNativeThreadId
+MONO_API MonoNativeThreadId
mono_native_thread_id_get (void);
gboolean
gboolean
mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg);
+MONO_API void
+mono_native_thread_set_name (MonoNativeThreadId tid, const char *name);
+
/*Mach specific internals */
void mono_threads_init_dead_letter (void);
void mono_threads_install_dead_letter (void);
typedef enum {
AbortBlockingIgnore, //Ignore
- AbortBlockingIgnoreAndPoll, //Ignore and pool
+ AbortBlockingIgnoreAndPoll, //Ignore and poll
AbortBlockingOk, //Abort worked
- AbortBlockingOkAndPool, //Abort worked, but pool before
+ AbortBlockingWait, //Abort worked, but should wait for resume
} MonoAbortBlockingResult;
MonoSelfSupendResult mono_threads_transition_state_poll (THREAD_INFO_TYPE *info);
MonoResumeResult mono_threads_transition_request_resume (THREAD_INFO_TYPE* info);
gboolean mono_threads_transition_finish_async_suspend (THREAD_INFO_TYPE* info);
-void mono_threads_transition_async_suspend_compensation (THREAD_INFO_TYPE* info);
MonoDoBlockingResult mono_threads_transition_do_blocking (THREAD_INFO_TYPE* info);
MonoDoneBlockingResult mono_threads_transition_done_blocking (THREAD_INFO_TYPE* info);
MonoAbortBlockingResult mono_threads_transition_abort_blocking (THREAD_INFO_TYPE* info);
MonoThreadUnwindState* mono_thread_info_get_suspend_state (THREAD_INFO_TYPE *info);
+gpointer
+mono_threads_enter_gc_unsafe_region_cookie (THREAD_INFO_TYPE *info);
+
void mono_thread_info_wait_for_resume (THREAD_INFO_TYPE *info);
/* Advanced suspend API, used for suspending multiple threads as once. */
gboolean mono_thread_info_begin_suspend (THREAD_INFO_TYPE *info);
gboolean mono_thread_info_begin_resume (THREAD_INFO_TYPE *info);
-gboolean
-mono_thread_info_check_suspend_result (THREAD_INFO_TYPE *info);
-
void mono_threads_add_to_pending_operation_set (THREAD_INFO_TYPE* info); //XXX rename to something to reflect the fact that this is used for both suspend and resume
gboolean mono_threads_wait_pending_operations (void);
void mono_threads_begin_global_suspend (void);