From 2e4812fe7082364ff5bb423b3365b0e6564e5db8 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 5 Sep 2016 19:18:08 +0200 Subject: Fix erts_thr_progress_unmanaged_delay() Thread progress leader update did not cache current unmanaged index when waiting for unmanaged threads. This caused erts_thr_progress_unmanaged_delay() to stop working until a new leader took over. --- erts/emulator/beam/erl_thr_progress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/emulator/beam/erl_thr_progress.c b/erts/emulator/beam/erl_thr_progress.c index 664c479eb6..83cdd56ead 100644 --- a/erts/emulator/beam/erl_thr_progress.c +++ b/erts/emulator/beam/erl_thr_progress.c @@ -699,6 +699,7 @@ leader_update(ErtsThrPrgrData *tpd) tpd->leader_state.chk_next_ix = no_managed; erts_atomic32_set_nob(&intrnl->misc.data.umrefc_ix.current, (erts_aint32_t) new_umrefc_ix); + tpd->leader_state.umrefc_ix.current = new_umrefc_ix; ETHR_MEMBAR(ETHR_StoreLoad); refc = erts_atomic_read_nob(&intrnl->umrefc[umrefc_ix].refc); ASSERT(refc >= 0); -- cgit v1.2.3