aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_lock_count.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-05-05 19:47:07 +0200
committerSverker Eriksson <[email protected]>2017-05-05 19:47:07 +0200
commit3f0e95a08394e92a58f99f99a94f9349e35842dd (patch)
treebd7f5c07c03bec93acbeea4e2fe23da4af838e31 /erts/emulator/beam/erl_lock_count.c
parent4f03eba5294f1c1bc922b07f1267e6b0099fd4b5 (diff)
downloadotp-3f0e95a08394e92a58f99f99a94f9349e35842dd.tar.gz
otp-3f0e95a08394e92a58f99f99a94f9349e35842dd.tar.bz2
otp-3f0e95a08394e92a58f99f99a94f9349e35842dd.zip
erts: Unbreak --enable-lock-checking --enable-lock-counter
both together. Broken in OTP-20.0-rc1 by 7d161f5b475575bd79bd90977b3a79334a8ec658.
Diffstat (limited to 'erts/emulator/beam/erl_lock_count.c')
-rw-r--r--erts/emulator/beam/erl_lock_count.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_lock_count.c b/erts/emulator/beam/erl_lock_count.c
index 6354fc8663..49b1f08b44 100644
--- a/erts/emulator/beam/erl_lock_count.c
+++ b/erts/emulator/beam/erl_lock_count.c
@@ -358,8 +358,11 @@ void erts_lcnt_init_lock(erts_lcnt_lock_t *lock, char *name, Uint16 flag ) {
void erts_lcnt_init_lock_x(erts_lcnt_lock_t *lock, char *name, Uint16 flag, Eterm id) {
int i;
- if (name == NULL) { ERTS_LCNT_CLEAR_FLAG(lock); return; }
- lcnt_lock();
+
+ if (flag & ERTS_LCNT_LT_DISABLE) {
+ ERTS_LCNT_CLEAR_FLAG(lock);
+ return;
+ }
lock->next = NULL;
lock->prev = NULL;
@@ -379,6 +382,7 @@ void erts_lcnt_init_lock_x(erts_lcnt_lock_t *lock, char *name, Uint16 flag, Eter
lcnt_clear_stats(&lock->stats[i]);
}
+ lcnt_lock();
erts_lcnt_list_insert(erts_lcnt_data->current_locks, lock);
lcnt_unlock();
}