From d5cf286306e2f82acef17fb4eb4003993177d1ae Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 30 May 2016 20:19:19 +0200 Subject: [PATCH] [threads] Make mono_thread_detach_if_exiting return if it detached --- mono/metadata/threads.c | 4 +++- mono/metadata/threads.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 8309ddbb540..63bb06d5416 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -1083,7 +1083,7 @@ mono_thread_detach (MonoThread *thread) * This should be used at the end of embedding code which calls into managed code, and which * can be called from pthread dtors, like dealloc: implementations in objective-c. */ -void +mono_bool mono_thread_detach_if_exiting (void) { if (mono_thread_info_is_exiting ()) { @@ -1093,8 +1093,10 @@ mono_thread_detach_if_exiting (void) if (thread) { mono_thread_detach_internal (thread); mono_thread_info_detach (); + return TRUE; } } + return FALSE; } void diff --git a/mono/metadata/threads.h b/mono/metadata/threads.h index b72072f3246..2ab8b09ea06 100644 --- a/mono/metadata/threads.h +++ b/mono/metadata/threads.h @@ -54,7 +54,7 @@ MONO_API void mono_threads_request_thread_dump (void); MONO_API mono_bool mono_thread_is_foreign (MonoThread *thread); -extern MONO_API void mono_thread_detach_if_exiting (void); +extern MONO_API mono_bool mono_thread_detach_if_exiting (void); MONO_END_DECLS -- 2.25.1