aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_util.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-01-24 19:50:25 +0100
committerRickard Green <[email protected]>2017-02-06 18:11:32 +0100
commitfc0477a67641b9ba344de595b7fec2431208f8e6 (patch)
treeab1933ee3e08cb4dd91e63663aab1f1f0c705129 /erts/emulator/beam/erl_db_util.h
parentbca5bf5a2d68a0e9ca681363a8943809c4751950 (diff)
downloadotp-fc0477a67641b9ba344de595b7fec2431208f8e6.tar.gz
otp-fc0477a67641b9ba344de595b7fec2431208f8e6.tar.bz2
otp-fc0477a67641b9ba344de595b7fec2431208f8e6.zip
Atomic reference count of binaries also in non-SMP
NIF resources was not handled in a thread-safe manner in the runtime system without SMP support. As a consequence of this fix, the following driver functions are now thread-safe also in the runtime system without SMP support: - driver_free_binary() - driver_realloc_binary() - driver_binary_get_refc() - driver_binary_inc_refc() - driver_binary_dec_refc()
Diffstat (limited to 'erts/emulator/beam/erl_db_util.h')
-rw-r--r--erts/emulator/beam/erl_db_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h
index 49e5f6b4cf..3fb063797e 100644
--- a/erts/emulator/beam/erl_db_util.h
+++ b/erts/emulator/beam/erl_db_util.h
@@ -211,7 +211,7 @@ typedef struct db_fixation {
*/
typedef struct db_table_common {
- erts_refc_t ref; /* fixation counter */
+ erts_smp_refc_t ref; /* fixation counter */
#ifdef ERTS_SMP
erts_smp_rwmtx_t rwlock; /* rw lock on table */
erts_smp_mtx_t fixlock; /* Protects fixations,megasec,sec,microsec */
@@ -260,7 +260,7 @@ typedef struct db_table_common {
(DB_BAG | DB_SET | DB_DUPLICATE_BAG)))
#define IS_TREE_TABLE(Status) (!!((Status) & \
DB_ORDERED_SET))
-#define NFIXED(T) (erts_refc_read(&(T)->common.ref,0))
+#define NFIXED(T) (erts_smp_refc_read(&(T)->common.ref,0))
#define IS_FIXED(T) (NFIXED(T) != 0)
/*