aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-02-18 19:44:24 +0100
committerSverker Eriksson <[email protected]>2016-02-18 19:44:24 +0100
commit184a4d38db21cdc3011a5c906f38c880c1ffdc58 (patch)
tree2bb847fabc3307397b60410e73cced26fa280161
parentd96471b3f404f7341279d8598dd74d92fb1a923c (diff)
downloadotp-184a4d38db21cdc3011a5c906f38c880c1ffdc58.tar.gz
otp-184a4d38db21cdc3011a5c906f38c880c1ffdc58.tar.bz2
otp-184a4d38db21cdc3011a5c906f38c880c1ffdc58.zip
erts: Fix lock checker for process locks
Do lock order check *before* trying to seize lock... duh!
-rw-r--r--erts/emulator/beam/erl_process_lock.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h
index a64c993e8f..9c59301086 100644
--- a/erts/emulator/beam/erl_process_lock.h
+++ b/erts/emulator/beam/erl_process_lock.h
@@ -523,6 +523,10 @@ erts_smp_proc_lock__(Process *p,
ERTS_LC_ASSERT((locks & ~ERTS_PROC_LOCKS_ALL) == 0);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_proc_lc_lock(p, locks, file, line);
+#endif
+
old_lflgs = erts_smp_proc_raw_trylock__(p, locks);
if (old_lflgs != 0) {
@@ -544,9 +548,6 @@ erts_smp_proc_lock__(Process *p,
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_proc_lock_post_x(&(p->lock), locks, file, line);
#endif
-#ifdef ERTS_ENABLE_LOCK_CHECK
- erts_proc_lc_lock(p, locks, file, line);
-#endif
#ifdef ERTS_PROC_LOCK_DEBUG
erts_proc_lock_op_debug(p, locks, 1);