aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_lock_flags.h
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2017-07-07 16:40:30 +0200
committerJohn Högberg <[email protected]>2017-07-07 16:42:50 +0200
commitf4661e4e1d234fdbcd37bbc4a8a9bfdf2cfaa586 (patch)
tree30f9b0473dcacaa7d10283af9692dcb06f480597 /erts/emulator/beam/erl_lock_flags.h
parentcc4de75dcb833610e52c7422b743c43556064a0a (diff)
downloadotp-f4661e4e1d234fdbcd37bbc4a8a9bfdf2cfaa586.tar.gz
otp-f4661e4e1d234fdbcd37bbc4a8a9bfdf2cfaa586.tar.bz2
otp-f4661e4e1d234fdbcd37bbc4a8a9bfdf2cfaa586.zip
Add a proper type for lock options
Diffstat (limited to 'erts/emulator/beam/erl_lock_flags.h')
-rw-r--r--erts/emulator/beam/erl_lock_flags.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_lock_flags.h b/erts/emulator/beam/erl_lock_flags.h
index b66c160af5..d711f69456 100644
--- a/erts/emulator/beam/erl_lock_flags.h
+++ b/erts/emulator/beam/erl_lock_flags.h
@@ -21,10 +21,10 @@
#ifndef ERTS_LOCK_FLAGS_H__
#define ERTS_LOCK_FLAGS_H__
-#define ERTS_LOCK_OPTION_READ (1 << 1)
-#define ERTS_LOCK_OPTION_WRITE (1 << 2)
+#define ERTS_LOCK_OPTIONS_READ (1 << 1)
+#define ERTS_LOCK_OPTIONS_WRITE (1 << 2)
-#define ERTS_LOCK_OPTION_RDWR (ERTS_LOCK_OPTION_READ | ERTS_LOCK_OPTION_WRITE)
+#define ERTS_LOCK_OPTIONS_RDWR (ERTS_LOCK_OPTIONS_READ | ERTS_LOCK_OPTIONS_WRITE)
/* Property/category are bitfields to simplify their use in masks. */
#define ERTS_LOCK_FLAGS_MASK_CATEGORY (0xFFC0)
@@ -67,8 +67,12 @@
/* -- -- */
typedef unsigned short erts_lock_flags_t;
+typedef unsigned short erts_lock_options_t;
/* @brief Gets the type name of the lock, honoring the RW flag if supplied. */
const char *erts_lock_flags_get_type_name(erts_lock_flags_t flags);
+/* @brief Gets a short-form description of the given lock options. (rw/r/w) */
+const char *erts_lock_options_get_short_desc(erts_lock_options_t options);
+
#endif /* ERTS_LOCK_FLAGS_H__ */