diff options
author | Sverker Eriksson <[email protected]> | 2014-10-20 16:04:44 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-10-20 16:04:44 +0200 |
commit | 3ca75c7e42ab2c0612ceb5e56f60e7932c40f335 (patch) | |
tree | c9d0a2c4f2138df26c881ac7643db0b64031b8ab /erts/emulator/beam | |
parent | dd853b15e9fb770a3f04fe4504fbfbb8de89e28d (diff) | |
download | otp-3ca75c7e42ab2c0612ceb5e56f60e7932c40f335.tar.gz otp-3ca75c7e42ab2c0612ceb5e56f60e7932c40f335.tar.bz2 otp-3ca75c7e42ab2c0612ceb5e56f60e7932c40f335.zip |
erts: Fix bug causing mbc to be deleted from cpool before it was inserted
Set IN_POOL flag _after_ mbc has been actually inserted.
Earlier it did not matter if IN_POOL was set early as it was not possible
to find a carrier before is was fully inserted. Now when searching
pooled_list and traitor_list we must make sure a found carrier has been
fully inserted into cpool before removing it.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_alloc_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c index 0ea9b62103..e3172dc4fb 100644 --- a/erts/emulator/beam/erl_alloc_util.c +++ b/erts/emulator/beam/erl_alloc_util.c @@ -2835,9 +2835,6 @@ cpool_insert(Allctr_t *allctr, Carrier_t *crr) (erts_aint_t) CARRIER_SZ(crr)); erts_atomic_inc_nob(&allctr->cpool.stat.no_carriers); - erts_smp_atomic_set_nob(&crr->allctr, - ((erts_aint_t) allctr)|ERTS_CRR_ALCTR_FLG_IN_POOL); - /* * We search in 'next' direction and begin by passing * one element before trying to insert. This in order to @@ -2896,6 +2893,9 @@ cpool_insert(Allctr_t *allctr, Carrier_t *crr) cpool_set_mod_marked(&cpd2p->prev, (erts_aint_t) &crr->cpool, (erts_aint_t) cpd1p); + + erts_smp_atomic_set_wb(&crr->allctr, + ((erts_aint_t) allctr)|ERTS_CRR_ALCTR_FLG_IN_POOL); } static void |