aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_catree.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-10-03 17:17:57 +0200
committerSverker Eriksson <[email protected]>2018-10-03 19:00:53 +0200
commit4324d0a42124a9e9be42c8bb2879db4660acb9e9 (patch)
treef85781c0b4d9491443802bf550c714b6ea366ba4 /erts/emulator/beam/erl_db_catree.h
parentd988f91307b2922de79f92d3b9aa160ac947b44c (diff)
downloadotp-4324d0a42124a9e9be42c8bb2879db4660acb9e9.tar.gz
otp-4324d0a42124a9e9be42c8bb2879db4660acb9e9.tar.bz2
otp-4324d0a42124a9e9be42c8bb2879db4660acb9e9.zip
erts: Add lock order check for route nodes
Lock order is reverse tree depth, from leafs toward root. This solution may eventually fail if running too long as route nodes do not increase their 'lc_order' in a join operation when they move up in the tree. But who runs a VM with lock-checker for such a long time?
Diffstat (limited to 'erts/emulator/beam/erl_db_catree.h')
-rw-r--r--erts/emulator/beam/erl_db_catree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_db_catree.h b/erts/emulator/beam/erl_db_catree.h
index 07a48d5bd3..0ad921d880 100644
--- a/erts/emulator/beam/erl_db_catree.h
+++ b/erts/emulator/beam/erl_db_catree.h
@@ -53,6 +53,9 @@ typedef struct {
} DbTableCATreeBaseNode;
typedef struct {
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ Sint lc_order;
+#endif
ErtsThrPrgrLaterOp free_item; /* Used when freeing using thread progress */
erts_mtx_t lock; /* Used when joining route nodes */
int is_valid; /* If this route node is still valid */