aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process_lock.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-01-23 17:37:49 +0100
committerSverker Eriksson <[email protected]>2017-01-23 17:37:49 +0100
commitadce9147ba242a8aef7d10cbbe8e4375ecdff0aa (patch)
tree688710d8612f621f7bcec662d1cf6f6fc5804ee3 /erts/emulator/beam/erl_process_lock.h
parent3f5530bf1ec283bbb8fd75e57947fe3218148ca1 (diff)
parent9e862df2bf26b9b1d79ba3b447945b7c0612e3d0 (diff)
downloadotp-adce9147ba242a8aef7d10cbbe8e4375ecdff0aa.tar.gz
otp-adce9147ba242a8aef7d10cbbe8e4375ecdff0aa.tar.bz2
otp-adce9147ba242a8aef7d10cbbe8e4375ecdff0aa.zip
Merge branch 'sverker/ASSERT_IN_ENV'
* sverker/ASSERT_IN_ENV: erts: Add macro ERTS_PROC_LOCKS_HIGHER_THAN erts: Cleanup and extra assertions in nif_SUITE.c erts: Cleanup enif_make_reverse_list erts: Add assertions for correct ErlNifEnv erts: Make erts_dbg_within_proc available # Conflicts: # erts/emulator/beam/erl_gc.h
Diffstat (limited to 'erts/emulator/beam/erl_process_lock.h')
-rw-r--r--erts/emulator/beam/erl_process_lock.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h
index 773529384f..46a72fcb0c 100644
--- a/erts/emulator/beam/erl_process_lock.h
+++ b/erts/emulator/beam/erl_process_lock.h
@@ -219,6 +219,10 @@ typedef struct erts_proc_lock_t_ {
#define ERTS_PROC_LOCKS_ALL_MINOR (ERTS_PROC_LOCKS_ALL \
& ~ERTS_PROC_LOCK_MAIN)
+/* All locks we first must unlock to lock L */
+#define ERTS_PROC_LOCKS_HIGHER_THAN(L) \
+ (ERTS_PROC_LOCKS_ALL & (~(L) & ~((L)-1)))
+
#define ERTS_PIX_LOCKS_BITS 10
#define ERTS_NO_OF_PIX_LOCKS (1 << ERTS_PIX_LOCKS_BITS)