[threads] Allow resetting the name of a threadpool thread (#4350)
[mono.git] / mono / mini / aot-compiler.c
index 630ab56ded71c0777a41df7cb559e2cf7ea54a31..6e91638d881fe1f3f3f97a4cf2c9d97e12c9555b 100644 (file)
@@ -56,7 +56,7 @@
 #include <mono/utils/json.h>
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/profiler/mono-profiler-aot.h>
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/w32api.h>
 
 #include "aot-compiler.h"
 #include "seq-points.h"
@@ -7897,7 +7897,7 @@ compile_thread_main (gpointer user_data)
 
        MonoError error;
        MonoThread *thread = mono_thread_attach (domain);
-       mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "AOT compiler"), TRUE, &error);
+       mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "AOT compiler"), TRUE, FALSE, &error);
        mono_error_assert_ok (&error);
 
        for (i = 0; i < methods->len; ++i)
@@ -10325,6 +10325,7 @@ load_profile_file (MonoAotCompile *acfg, char *filename)
                }
        }
 
+       fclose (infile);
        acfg->profile_data = g_list_append (acfg->profile_data, data);
 }