aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_util.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2011-07-08 13:56:10 +0200
committerRickard Green <[email protected]>2011-07-08 13:56:10 +0200
commitc6bc815813f57fb7dfffe704c31a4124a0fe755e (patch)
tree6d142c893ee4e9f800b094bba26537147cf5b2de /erts/emulator/beam/erl_db_util.c
parent5c62fdc1914000f3da921c82a82b6dc30783db53 (diff)
parent0204e80cba378dfc1140a7f98d96705d470bddde (diff)
downloadotp-c6bc815813f57fb7dfffe704c31a4124a0fe755e.tar.gz
otp-c6bc815813f57fb7dfffe704c31a4124a0fe755e.tar.bz2
otp-c6bc815813f57fb7dfffe704c31a4124a0fe755e.zip
Merge branch 'rickard/atomics-api/OTP-9014' into major
* rickard/atomics-api/OTP-9014: Use new atomic API in runtime system Improve ethread atomics
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r--erts/emulator/beam/erl_db_util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index c3b074f782..f9896a60e6 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -491,7 +491,7 @@ erts_match_set_release_result(Process* c_p)
/* The trace control word. */
-static erts_smp_atomic_t trace_control_word;
+static erts_smp_atomic32_t trace_control_word;
/* This needs to be here, before the bif table... */
@@ -911,7 +911,7 @@ static void db_free_tmp_uncompressed(DbTerm* obj);
BIF_RETTYPE db_get_trace_control_word_0(Process *p)
{
- Uint32 tcw = (Uint32) erts_smp_atomic_read(&trace_control_word);
+ Uint32 tcw = (Uint32) erts_smp_atomic32_read_acqb(&trace_control_word);
BIF_RET(erts_make_integer((Uint) tcw, p));
}
@@ -924,7 +924,8 @@ BIF_RETTYPE db_set_trace_control_word_1(Process *p, Eterm new)
if (val != ((Uint32)val))
BIF_ERROR(p, BADARG);
- old_tcw = (Uint32) erts_smp_atomic_xchg(&trace_control_word, (erts_aint_t) val);
+ old_tcw = (Uint32) erts_smp_atomic32_xchg_relb(&trace_control_word,
+ (erts_aint32_t) val);
BIF_RET(erts_make_integer((Uint) old_tcw, p));
}
@@ -1249,7 +1250,7 @@ void db_initialize_util(void){
sizeof(DMCGuardBif),
(int (*)(const void *, const void *)) &cmp_guard_bif);
match_pseudo_process_init();
- erts_smp_atomic_init(&trace_control_word, 0);
+ erts_smp_atomic32_init_nob(&trace_control_word, 0);
}