aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2012-12-11 16:56:25 +0100
committerRickard Green <[email protected]>2012-12-11 16:56:25 +0100
commit17532edb1301f52c1dbc37955a527bb1da333b4d (patch)
tree40620bf882a83a92092ef052d2048ad50eebba29 /erts/emulator
parent3d68194518f154c9c7e440b096c311cd2572dd78 (diff)
parent70debf33fadd0b897995365266bc6457abd8e62b (diff)
downloadotp-17532edb1301f52c1dbc37955a527bb1da333b4d.tar.gz
otp-17532edb1301f52c1dbc37955a527bb1da333b4d.tar.bz2
otp-17532edb1301f52c1dbc37955a527bb1da333b4d.zip
Merge branch 'rickard/r16/port-optimizations/OTP-10336'
* rickard/r16/port-optimizations/OTP-10336: Fix bit set op of non-atomic fallback in atomic API Fix debug build on threads disabled build
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_threads.h2
-rw-r--r--erts/emulator/beam/io.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_threads.h b/erts/emulator/beam/erl_threads.h
index 0e759a1eec..1dc3ffeb3c 100644
--- a/erts/emulator/beam/erl_threads.h
+++ b/erts/emulator/beam/erl_threads.h
@@ -2138,6 +2138,7 @@ erts_no_atomic_read_bset(erts_no_atomic_t *var,
erts_aint_t set)
{
erts_aint_t old = *var;
+ *var &= ~mask;
*var |= (mask & set);
return old;
}
@@ -2235,6 +2236,7 @@ erts_no_atomic32_read_bset(erts_no_atomic32_t *var,
erts_aint32_t set)
{
erts_aint32_t old = *var;
+ *var &= ~mask;
*var |= (mask & set);
return old;
}
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 3fc124589b..be094862d4 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -434,7 +434,7 @@ erts_port_cleanup(Port *prt)
void
erts_port_free(Port *prt)
{
-#if defined(ERTS_SMP) || defined(ERTS_ENABLE_LOCK_CHECK)
+#if defined(ERTS_SMP) || defined(DEBUG) || defined(ERTS_ENABLE_LOCK_CHECK)
erts_aint32_t state = erts_atomic32_read_nob(&prt->state);
#endif
ERTS_LC_ASSERT(state & (ERTS_PORT_SFLG_INITIALIZING