[threadpool] Let the runtime abort and wait for threads on shutdown (#4348)
[mono.git] / mono / mini / mini-runtime.c
index ece3233935909c31244c455544e7dea8776d227f..a567bf0507fb77771f28e305a07674418a0f5e63 100644 (file)
@@ -66,6 +66,7 @@
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/utils/checked-build.h>
 #include <mono/metadata/w32handle.h>
+#include <mono/metadata/threadpool.h>
 
 #include "mini.h"
 #include "seq-points.h"
@@ -4110,6 +4111,8 @@ mini_cleanup (MonoDomain *domain)
        mono_runtime_cleanup (domain);
 #endif
 
+       mono_threadpool_cleanup ();
+
        mono_profiler_shutdown ();
 
        free_jit_tls_data ((MonoJitTlsData *)mono_tls_get_jit_tls ());