aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_init.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-02-08 18:00:45 +0100
committerSverker Eriksson <[email protected]>2016-02-08 18:00:45 +0100
commit6392637b184ac3172c61025889f3087e5739bb72 (patch)
tree7defce40c56982e16580c15a607dc3e0048a81c2 /erts/emulator/beam/erl_init.c
parentfcb5fc90e891d56b83927c8403d97da0faca0e41 (diff)
parente9d6797e15e687828e5ef0d33fb790181d657779 (diff)
downloadotp-6392637b184ac3172c61025889f3087e5739bb72.tar.gz
otp-6392637b184ac3172c61025889f3087e5739bb72.tar.bz2
otp-6392637b184ac3172c61025889f3087e5739bb72.zip
Merge branch 'sverk/thread-unsafe-alloc'
* sverk/thread-unsafe-alloc: erts: Fix faulty assert for non-smp erts: Add checks for thread safe allocation
Diffstat (limited to 'erts/emulator/beam/erl_init.c')
-rw-r--r--erts/emulator/beam/erl_init.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 520b504fcb..67089df863 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -152,7 +152,7 @@ volatile int erts_writing_erl_crash_dump = 0;
int erts_initialized = 0;
#if defined(USE_THREADS) && !defined(ERTS_SMP)
-static erts_tid_t main_thread;
+erts_tid_t erts_main_thread;
#endif
int erts_use_sender_punish;
@@ -745,6 +745,10 @@ early_init(int *argc, char **argv) /*
char envbuf[21]; /* enough for any 64-bit integer */
size_t envbufsz;
+#if defined(USE_THREADS) && !defined(ERTS_SMP)
+ erts_main_thread = erts_thr_self();
+#endif
+
erts_save_emu_args(*argc, argv);
erts_sched_compact_load = 1;
@@ -798,9 +802,6 @@ early_init(int *argc, char **argv) /*
(erts_aint32_t) ((Uint16) -1));
erts_pre_init_process();
-#if defined(USE_THREADS) && !defined(ERTS_SMP)
- main_thread = erts_thr_self();
-#endif
/*
* We need to know the number of schedulers to use before we
@@ -2288,7 +2289,7 @@ system_cleanup(int flush_async)
if (!flush_async
|| !erts_initialized
#if defined(USE_THREADS) && !defined(ERTS_SMP)
- || !erts_equal_tids(main_thread, erts_thr_self())
+ || !erts_equal_tids(erts_main_thread, erts_thr_self())
#endif
)
return;