Skip to content

Commit 62c9d53

Browse files
committed
move process_initialized assignment to after thread initialization (see also issue #1209)
1 parent de0cb7e commit 62c9d53

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,6 @@ void mi_process_init(void) mi_attr_noexcept {
943943
// mi_heap_main_init(); // vs2017 can dynamically re-initialize theap_main
944944
// #endif
945945
if (!mi_atomic_once(&process_init)) return;
946-
_mi_process_is_initialized = true;
947946
_mi_verbose_message("process init: 0x%zx\n", _mi_thread_id());
948947

949948
mi_detect_cpu_features();
@@ -955,6 +954,7 @@ void mi_process_init(void) mi_attr_noexcept {
955954
mi_heap_main_init(); // before page_map_init so stats are working
956955
_mi_page_map_init(); // todo: this could fail.. should we abort in that case?
957956
mi_thread_init();
957+
_mi_process_is_initialized = true;
958958

959959
#if defined(_WIN32) && defined(MI_WIN_USE_FLS)
960960
// On windows, when building as a static lib the FLS cleanup happens to early for the main thread.

0 commit comments

Comments
 (0)