[threadpool] Let the runtime abort and wait for threads on shutdown (#4348)
[mono.git] / mono / mini / mini-runtime.c
index 9eade804217ea75654fc94e2b1a1e5eb3ecfa823..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"
 #endif
 #endif
 
+#ifdef ENABLE_INTERPRETER
+#include "interpreter/interp.h"
+#endif
+
 static guint32 default_opt = 0;
 static gboolean default_opt_set = FALSE;
 
@@ -1769,7 +1774,7 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoError *er
 
 #ifdef ENABLE_INTERPRETER
        if (mono_use_interpreter)
-               return interp_create_method_pointer (method, error);
+               return mono_interp_create_method_pointer (method, error);
 #endif
 
        if (mono_llvm_only)
@@ -2359,7 +2364,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
 
 #ifdef ENABLE_INTERPRETER
        if (mono_use_interpreter)
-               return interp_mono_runtime_invoke (method, obj, params, exc, error);
+               return mono_interp_runtime_invoke (method, obj, params, exc, error);
 #endif
 
        mono_error_init (error);
@@ -4106,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 ());