Merge pull request #5504 from ntherning/wait-for-native-thread-to-die-in-Thread-Join
[mono.git] / mono / metadata / threads.c
index 4e29232b78557608570ce0052c1464e348ddda2f..3eb6b3b623c8994cf3b2442b79a4270c2eebcc0b 100644 (file)
@@ -3049,6 +3049,8 @@ mono_thread_callbacks_init (void)
 void
 mono_thread_cleanup (void)
 {
+       mono_threads_join_threads ();
+
 #if !defined(RUN_IN_SUBTHREAD) && !defined(HOST_WIN32)
        /* The main thread must abandon any held mutexes (particularly
         * important for named mutexes as they are shared across