diff options
author | John Högberg <[email protected]> | 2017-06-22 13:22:13 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2017-07-06 12:29:42 +0200 |
commit | f3fa8288287072195baa791ee11d5480d3cd45ff (patch) | |
tree | 7099c828834a43fde1c3fde0a6c151bdf9042807 /erts/emulator/beam/safe_hash.h | |
parent | e9bb277cc5cc8326c3c90ed82954f2ee14c1844b (diff) | |
download | otp-f3fa8288287072195baa791ee11d5480d3cd45ff.tar.gz otp-f3fa8288287072195baa791ee11d5480d3cd45ff.tar.bz2 otp-f3fa8288287072195baa791ee11d5480d3cd45ff.zip |
Allow toggling lock counting at runtime
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and
all categories are still enabled by default, but the actual counting can be
toggled at will.
OTP-13170
Diffstat (limited to 'erts/emulator/beam/safe_hash.h')
-rw-r--r-- | erts/emulator/beam/safe_hash.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/erts/emulator/beam/safe_hash.h b/erts/emulator/beam/safe_hash.h index 285103cb17..dde48a6de8 100644 --- a/erts/emulator/beam/safe_hash.h +++ b/erts/emulator/beam/safe_hash.h @@ -28,6 +28,7 @@ #include "sys.h" #include "erl_alloc.h" +#include "erl_lock_flags.h" typedef unsigned long SafeHashValue; @@ -85,7 +86,7 @@ typedef struct /* A: Lockless atomics */ } SafeHash; -SafeHash* safe_hash_init(ErtsAlcType_t, SafeHash*, char*, int, SafeHashFunctions); +SafeHash* safe_hash_init(ErtsAlcType_t, SafeHash*, char*, erts_lock_flags_t, int, SafeHashFunctions); void safe_hash_get_info(SafeHashInfo*, SafeHash*); int safe_hash_table_sz(SafeHash *); @@ -96,5 +97,9 @@ void* safe_hash_erase(SafeHash*, void*); void safe_hash_for_each(SafeHash*, void (*func)(void *, void *), void *); +#ifdef ERTS_ENABLE_LOCK_COUNT +void erts_lcnt_enable_hash_lock_count(SafeHash*, erts_lock_flags_t, int); +#endif + #endif /* __SAFE_HASH_H__ */ |