gboolean
mono_thread_internal_current_is_attached (void);
+void
+mono_thread_internal_describe (MonoInternalThread *internal, GString *str);
+
#endif /* _MONO_METADATA_THREADS_TYPES_H_ */
#if 0
/* This no longer works with remote unwinding */
g_string_append_printf (text, " tid=0x%p this=0x%p ", (gpointer)(gsize)thread->tid, thread);
- mono_thread_info_describe (info, text);
+ mono_thread_internal_describe (thread, text);
g_string_append (text, "\n");
#endif
UNLOCK_THREAD (thread);
return TRUE;
-}
\ No newline at end of file
+}
+
+void
+mono_thread_internal_describe (MonoInternalThread *internal, GString *text)
+{
+ MonoThreadInfo *info;
+
+ g_string_append_printf (text, ", thread handle : %p", internal->handle);
+
+ info = (MonoThreadInfo*) internal->thread_info;
+ if (!info)
+ return;
+
+ g_string_append (text, ", state : ");
+ mono_thread_info_describe_interrupt_token (info, text);
+
+ if (info->owned_mutexes) {
+ int i;
+
+ g_string_append (text, ", owns : [");
+ for (i = 0; i < info->owned_mutexes->len; i++)
+ g_string_append_printf (text, i == 0 ? "%p" : ", %p", g_ptr_array_index (info->owned_mutexes, i));
+ g_string_append (text, "]");
+ }
+}
g_string_append (text, "\n\"<unnamed thread>\"");
g_string_append_printf (text, " tid=0x%p this=0x%p ", (gpointer)(gsize)thread->tid, thread);
- mono_thread_info_describe ((MonoThreadInfo*) thread->thread_info, text);
+ mono_thread_internal_describe (thread, text);
g_string_append (text, "\n");
#ifdef MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX
info->handle = NULL;
}
-void
-mono_threads_platform_describe (MonoThreadInfo *info, GString *text)
-{
- int i;
-
- g_string_append_printf (text, "thread handle %p state : ", info->handle);
-
- mono_thread_info_describe_interrupt_token (info, text);
-
- g_string_append_printf (text, ", owns (");
- for (i = 0; i < info->owned_mutexes->len; i++)
- g_string_append_printf (text, i > 0 ? ", %p" : "%p", g_ptr_array_index (info->owned_mutexes, i));
- g_string_append_printf (text, ")");
-}
-
void
mono_threads_platform_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
{
info->handle = NULL;
}
-void
-mono_threads_platform_describe (MonoThreadInfo *info, GString *text)
-{
- /* TODO */
-}
-
void
mono_threads_platform_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
{
return mono_threads_platform_duplicate_handle (info);
}
-void
-mono_thread_info_describe (MonoThreadInfo *info, GString *text)
-{
- mono_threads_platform_describe (info, text);
-}
-
void
mono_thread_info_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
{
/* Stack mark for targets that explicitly require one */
gpointer stack_mark;
-#if defined(_POSIX_VERSION) || defined(__native_client__)
- /* This is the data that was stored in the w32 handle */
+ /* FIXME: move to MonoInternalThread */
GPtrArray *owned_mutexes;
-#endif
} MonoThreadInfo;
typedef struct {
HANDLE mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
void mono_threads_platform_close_thread_handle (HANDLE handle);
void mono_threads_platform_set_exited (THREAD_INFO_TYPE *info);
-void mono_threads_platform_describe (THREAD_INFO_TYPE *info, GString *text);
void mono_threads_platform_own_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
void mono_threads_platform_disown_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
gpointer mono_threads_platform_duplicate_handle (THREAD_INFO_TYPE *info);
gpointer
mono_thread_info_duplicate_handle (THREAD_INFO_TYPE *info);
-void
-mono_thread_info_describe (THREAD_INFO_TYPE *info, GString *text);
-
void
mono_thread_info_own_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);