Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[threads] Make mono_thread_detach_if_exiting return if it detached
  • Loading branch information
luhenry committed Jun 2, 2016
1 parent 12e53bc commit d5cf286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mono/metadata/threads.c
Expand Up @@ -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 ()) {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mono/metadata/threads.h
Expand Up @@ -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

Expand Down

0 comments on commit d5cf286

Please sign in to comment.