X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-threads.h;h=5eea9d0b56e15aa73d6686403acf054868e74522;hb=066284a9caebde26db0248f18bb6b4082e700c19;hp=1019dda1884e4c078e4f9de583e74a339c223bfc;hpb=62c49f89ad1cc35593a00d909ea57bb41955288b;p=mono.git diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index 1019dda1884..5eea9d0b56e 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -164,13 +164,6 @@ enum { 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 { @@ -198,10 +191,11 @@ 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; @@ -241,12 +235,6 @@ typedef struct { /* 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; @@ -346,7 +334,7 @@ mono_thread_info_register_small_id (void); THREAD_INFO_TYPE * mono_thread_info_attach (void *baseptr); -void +MONO_API void mono_thread_info_detach (void); gboolean @@ -370,9 +358,6 @@ mono_thread_info_lookup (MonoNativeThreadId id); 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); @@ -466,17 +451,6 @@ mono_threads_get_max_stack_size (void); 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); @@ -542,12 +516,11 @@ 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); -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 @@ -556,6 +529,9 @@ mono_native_thread_id_equals (MonoNativeThreadId id1, MonoNativeThreadId id2); 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); @@ -612,9 +588,9 @@ typedef enum { 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; @@ -625,13 +601,15 @@ MonoRequestAsyncSuspendResult mono_threads_transition_request_async_suspension ( 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. */ @@ -645,9 +623,6 @@ gboolean mono_thread_info_in_critical_location (THREAD_INFO_TYPE *info); 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);