aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common/erl_mseg.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2011-10-10 21:03:10 +0200
committerRickard Green <[email protected]>2011-11-13 20:40:56 +0100
commitbc5818cfdd56e19a16357f4443d80a56426aa134 (patch)
treebfe53d3e0cf24ccd7374e0174c1a4c441ab2e097 /erts/emulator/sys/common/erl_mseg.c
parenta67e91e658bdbba24fcc3c79b06fdf10ff830bc9 (diff)
downloadotp-bc5818cfdd56e19a16357f4443d80a56426aa134.tar.gz
otp-bc5818cfdd56e19a16357f4443d80a56426aa134.tar.bz2
otp-bc5818cfdd56e19a16357f4443d80a56426aa134.zip
Replace system block with thread progress block
The ERTS internal system block functionality has been replaced by new functionality for blocking the system. The old system block functionality had contention issues and complexity issues. The new functionality piggy-backs on thread progress tracking functionality needed by newly introduced lock-free synchronization in the runtime system. When the functionality for blocking the system isn't used there is more or less no overhead at all. This since the functionality for tracking thread progress is there and needed anyway.
Diffstat (limited to 'erts/emulator/sys/common/erl_mseg.c')
-rw-r--r--erts/emulator/sys/common/erl_mseg.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c
index 3a90db607b..49750ff6ce 100644
--- a/erts/emulator/sys/common/erl_mseg.c
+++ b/erts/emulator/sys/common/erl_mseg.c
@@ -38,6 +38,7 @@
#include "erl_time.h"
#include "erl_alloc.h"
#include "big.h"
+#include "erl_thr_progress.h"
#if HAVE_ERTS_MSEG
@@ -450,14 +451,12 @@ mseg_recreate(ErtsMsegAllctr_t *ma, MemKind* mk, void *old_seg, Uint old_size, U
do { \
if ((MA)->is_thread_safe) \
ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&(MA)->mtx) \
- || erts_smp_is_system_blocked(0) \
- || (ERTS_IS_CRASH_DUMPING \
- && erts_smp_is_system_blocked(ERTS_BS_FLG_ALLOW_GC)));\
+ || erts_smp_thr_progress_is_blocking() \
+ || ERTS_IS_CRASH_DUMPING); \
else \
ERTS_LC_ASSERT((MA)->ix == (int) erts_get_scheduler_id() \
- || erts_smp_is_system_blocked(0) \
- || (ERTS_IS_CRASH_DUMPING \
- && erts_smp_is_system_blocked(ERTS_BS_FLG_ALLOW_GC)));\
+ || erts_smp_thr_progress_is_blocking() \
+ || ERTS_IS_CRASH_DUMPING); \
} while (0)
#define ERTS_DBG_MK_CHK_THR_ACCESS(MK) \
ERTS_DBG_MA_CHK_THR_ACCESS((MK)->ma)