diff options
author | Sverker Eriksson <[email protected]> | 2013-10-01 17:11:27 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-10-02 17:00:23 +0200 |
commit | e9f670e542dd2ea2dc29dff66d3516a3fd0d2d21 (patch) | |
tree | 0971c00c859c28ce74d7ff6170c4e7f27f56dbad /erts/emulator | |
parent | ee39709b4ae375277c6380033c9c9f04b0242b43 (diff) | |
download | otp-e9f670e542dd2ea2dc29dff66d3516a3fd0d2d21.tar.gz otp-e9f670e542dd2ea2dc29dff66d3516a3fd0d2d21.tar.bz2 otp-e9f670e542dd2ea2dc29dff66d3516a3fd0d2d21.zip |
erts: Fix lock violation for init_atoms in erl_mmap.c
by not holding the mseg lock while reading version and option info
which is unnecessary anyway.
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/sys/common/erl_mseg.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index b165f76c96..94a381e168 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -962,8 +962,6 @@ init_atoms(ErtsMsegAllctr_t *ma) #ifdef DEBUG Eterm *atom; #endif - - ERTS_MSEG_UNLOCK(ma); erts_mtx_lock(&init_atoms_mutex); if (!atoms_initialized) { @@ -1007,7 +1005,6 @@ init_atoms(ErtsMsegAllctr_t *ma) #endif } - ERTS_MSEG_LOCK(ma); atoms_initialized = 1; erts_mtx_unlock(&init_atoms_mutex); } @@ -1293,14 +1290,8 @@ erts_mseg_info_options(int ix, ErtsMsegAllctr_t *ma = ERTS_MSEG_ALLCTR_IX(ix); Eterm res; - ERTS_MSEG_LOCK(ma); - - ERTS_DBG_MA_CHK_THR_ACCESS(ma); - res = info_options(ma, "option ", print_to_p, print_to_arg, hpp, szp); - ERTS_MSEG_UNLOCK(ma); - return res; } @@ -1318,10 +1309,6 @@ erts_mseg_info(int ix, Eterm values[4]; Uint n = 0; - ERTS_MSEG_LOCK(ma); - - ERTS_DBG_MA_CHK_THR_ACCESS(ma); - if (hpp || szp) { if (!atoms_initialized) @@ -1334,6 +1321,10 @@ erts_mseg_info(int ix, } values[n++] = info_version(ma, print_to_p, print_to_arg, hpp, szp); values[n++] = info_options(ma, "option ", print_to_p, print_to_arg, hpp, szp); + + ERTS_MSEG_LOCK(ma); + ERTS_DBG_MA_CHK_THR_ACCESS(ma); + #if HALFWORD_HEAP values[n++] = info_memkind(ma, &ma->low_mem, print_to_p, print_to_arg, begin_max_per, hpp, szp); values[n++] = info_memkind(ma, &ma->hi_mem, print_to_p, print_to_arg, begin_max_per, hpp, szp); |