projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e31a8ef
)
[threads] Destroy thread->suspended before removing the GC root to thread (#4133)
author
Ludovic Henry
<ludovic@xamarin.com>
Mon, 12 Dec 2016 23:57:07 +0000
(18:57 -0500)
committer
GitHub
<noreply@github.com>
Mon, 12 Dec 2016 23:57:07 +0000
(18:57 -0500)
mono/metadata/threads.c
patch
|
blob
|
history
diff --git
a/mono/metadata/threads.c
b/mono/metadata/threads.c
index 953a2315008f047a7dced9b39f53a9d0f218a3f2..84649c6f9de5243e23b84a97be1118379845d7d6 100644
(file)
--- a/
mono/metadata/threads.c
+++ b/
mono/metadata/threads.c
@@
-1113,6
+1113,11
@@
mono_thread_detach_internal (MonoInternalThread *thread)
ref_stack_destroy (thread->appdomain_refs);
thread->appdomain_refs = NULL;
ref_stack_destroy (thread->appdomain_refs);
thread->appdomain_refs = NULL;
+ g_assert (thread->suspended);
+ mono_os_event_destroy (thread->suspended);
+ g_free (thread->suspended);
+ thread->suspended = NULL;
+
if (mono_thread_cleanup_fn)
mono_thread_cleanup_fn (thread_get_tid (thread));
if (mono_thread_cleanup_fn)
mono_thread_cleanup_fn (thread_get_tid (thread));
@@
-1121,11
+1126,6
@@
mono_thread_detach_internal (MonoInternalThread *thread)
thread->thread_pinning_ref = NULL;
}
thread->thread_pinning_ref = NULL;
}
- g_assert (thread->suspended);
- mono_os_event_destroy (thread->suspended);
- g_free (thread->suspended);
- thread->suspended = NULL;
-
done:
SET_CURRENT_OBJECT (NULL);
mono_domain_unset ();
done:
SET_CURRENT_OBJECT (NULL);
mono_domain_unset ();