aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-03-21 14:35:24 +0100
committerRickard Green <[email protected]>2015-03-21 14:35:24 +0100
commitc8859fae10da567e13a0090c6cc04f4de634dc73 (patch)
treea933edfa62405fa11b09ede37f870d8d430c0b70 /erts/emulator
parentb99ce1c3a64f24e68b8a937338546fdf60501c65 (diff)
parent50713b7d6179477d6018e6a9ca5610617e3de1fe (diff)
downloadotp-c8859fae10da567e13a0090c6cc04f4de634dc73.tar.gz
otp-c8859fae10da567e13a0090c6cc04f4de634dc73.tar.bz2
otp-c8859fae10da567e13a0090c6cc04f4de634dc73.zip
Merge branch 'rickard/time_api/OTP-11997'
* rickard/time_api/OTP-11997: Unbreak lcnt
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_init.c1
-rw-r--r--erts/emulator/beam/erl_time.h1
-rw-r--r--erts/emulator/beam/erl_time_sup.c3
-rw-r--r--erts/emulator/beam/sys.h1
-rw-r--r--erts/emulator/sys/unix/sys.c17
-rw-r--r--erts/emulator/sys/win32/sys.c26
6 files changed, 32 insertions, 17 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 5aeb5b2590..86d3416423 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -1171,7 +1171,6 @@ early_init(int *argc, char **argv) /*
/* Creates threads on Windows that depend on the arguments, so has to be after erl_sys_args */
erl_sys_init();
- erts_early_init_time_sup();
erts_ets_realloc_always_moves = 0;
erts_ets_always_compress = 0;
diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h
index f201a8b4e3..c9cda4d10e 100644
--- a/erts/emulator/beam/erl_time.h
+++ b/erts/emulator/beam/erl_time.h
@@ -77,7 +77,6 @@ void erts_cancel_smp_ptimer(ErtsSmpPTimer *ptimer);
void erts_monitor_time_offset(Eterm id, Eterm ref);
int erts_demonitor_time_offset(Eterm ref);
-void erts_early_init_time_sup(void);
void erts_late_init_time_sup(void);
/* timer-wheel api */
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index d47d1682d7..b809fa8316 100644
--- a/erts/emulator/beam/erl_time_sup.c
+++ b/erts/emulator/beam/erl_time_sup.c
@@ -765,8 +765,7 @@ erts_has_time_correction(void)
return time_sup.r.o.correction;
}
-void
-erts_early_init_time_sup(void)
+void erts_init_sys_time_sup(void)
{
ErtsSysInitTimeResult sys_init_time_res
= ERTS_SYS_INIT_TIME_RESULT_INITER;
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index aeb28e72f3..a0f35fef1b 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -724,6 +724,7 @@ typedef struct {
#define ERTS_SYS_INIT_TIME_RESULT_INITER \
{0, (ErtsMonotonicTime) -1, (ErtsMonotonicTime) 1}
+extern void erts_init_sys_time_sup(void);
extern void sys_init_time(ErtsSysInitTimeResult *);
extern void erts_deliver_time(void);
extern void erts_time_remaining(SysTimeval *);
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index 2eb0ffa905..f1c785890c 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -532,11 +532,14 @@ thr_create_prepare_child(void *vtcdp)
void
erts_sys_pre_init(void)
{
+#ifdef USE_THREADS
+ erts_thr_init_data_t eid = ERTS_THR_INIT_DATA_DEF_INITER;
+#endif
+
erts_printf_add_cr_to_stdout = 1;
erts_printf_add_cr_to_stderr = 1;
+
#ifdef USE_THREADS
- {
- erts_thr_init_data_t eid = ERTS_THR_INIT_DATA_DEF_INITER;
eid.thread_create_child_func = thr_create_prepare_child;
/* Before creation in parent */
@@ -553,6 +556,12 @@ erts_sys_pre_init(void)
erts_thr_init(&eid);
+#endif /* USE_THREADS */
+
+ erts_init_sys_time_sup();
+
+#ifdef USE_THREADS
+
report_exit_list = NULL;
#ifdef ERTS_ENABLE_LOCK_COUNT
@@ -569,7 +578,7 @@ erts_sys_pre_init(void)
erts_cnd_init(&chld_stat_cnd);
children_alive = 0;
#endif
- }
+
#ifdef ERTS_SMP
erts_smp_atomic32_init_nob(&erts_break_requested, 0);
erts_smp_atomic32_init_nob(&erts_got_sigusr1, 0);
@@ -582,7 +591,9 @@ erts_sys_pre_init(void)
#if !CHLDWTHR && !defined(ERTS_SMP)
children_died = 0;
#endif
+
#endif /* USE_THREADS */
+
erts_smp_atomic_init_nob(&sys_misc_mem_sz, 0);
{
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index 1ba87b8b0b..cf587af4ac 100644
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -3172,25 +3172,31 @@ thr_create_prepare_child(void *vtcdp)
void
erts_sys_pre_init(void)
{
+#ifdef USE_THREADS
+ erts_thr_init_data_t eid = ERTS_THR_INIT_DATA_DEF_INITER;
+#endif
int_os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&int_os_version);
check_supported_os_version();
+
#ifdef USE_THREADS
- {
- erts_thr_init_data_t eid = ERTS_THR_INIT_DATA_DEF_INITER;
+ eid.thread_create_child_func = thr_create_prepare_child;
+ /* Before creation in parent */
+ eid.thread_create_prepare_func = thr_create_prepare;
+ /* After creation in parent */
+ eid.thread_create_parent_func = thr_create_cleanup;
- eid.thread_create_child_func = thr_create_prepare_child;
- /* Before creation in parent */
- eid.thread_create_prepare_func = thr_create_prepare;
- /* After creation in parent */
- eid.thread_create_parent_func = thr_create_cleanup,
+ erts_thr_init(&eid);
+#endif
- erts_thr_init(&eid);
+ erts_init_sys_time_sup();
+
+#ifdef USE_THREADS
#ifdef ERTS_ENABLE_LOCK_COUNT
- erts_lcnt_init();
+ erts_lcnt_init();
#endif
- }
#endif
+
erts_smp_atomic_init_nob(&sys_misc_mem_sz, 0);
}