aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-05-11 12:09:10 +0200
committerSverker Eriksson <[email protected]>2017-05-11 12:09:10 +0200
commit5aa7180ae0ad7a34d1903003cbcd4a7d5cc61858 (patch)
treedeef1efc781432b197c04be9f86a1352f88b00bd /erts/emulator/beam/io.c
parent57faf8743b693f02eda2ba0a379e234f554d5e96 (diff)
parenteb9ffb378b9eb3b9f4a0f898e60ade01d3d48283 (diff)
downloadotp-5aa7180ae0ad7a34d1903003cbcd4a7d5cc61858.tar.gz
otp-5aa7180ae0ad7a34d1903003cbcd4a7d5cc61858.tar.bz2
otp-5aa7180ae0ad7a34d1903003cbcd4a7d5cc61858.zip
Merge branch 'sverker/fix-lc-with-lcnt'
* sverker/fix-lc-with-lcnt: erts: Add minor lock optimization for lcnt erts: Unbreak --enable-lock-checking --enable-lock-counter
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index bf89740fda..93a5ed4397 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -260,10 +260,12 @@ static ERTS_INLINE void port_init_instr(Port *prt
if (!prt->drv_ptr->lock) {
char *lock_str = "port_lock";
#ifdef ERTS_ENABLE_LOCK_COUNT
- if (!(erts_lcnt_rt_options & ERTS_LCNT_OPT_PORTLOCK))
- lock_str = NULL;
+ Uint16 opt = ((erts_lcnt_rt_options & ERTS_LCNT_OPT_PORTLOCK)
+ ? 0 : ERTS_LCNT_LT_DISABLE);
+#else
+ Uint16 opt = 0;
#endif
- erts_mtx_init_locked_x(prt->lock, lock_str, id);
+ erts_mtx_init_locked_x_opt(prt->lock, lock_str, id, opt);
}
#endif
erts_port_task_init_sched(&prt->sched, id);