aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-06-10 18:07:56 +0200
committerRickard Green <[email protected]>2015-06-10 18:07:56 +0200
commit98ea0ed0985d1e9788b235de996befb8d6344abd (patch)
treedc1e2c969d7c469c35ed87948dba6dd735e83e59 /erts/emulator
parentc8825f09f5df654ab89d417af827bfaa7f185066 (diff)
parent014865c474c4e8229cae556d9dff22ba75d6a5bb (diff)
downloadotp-98ea0ed0985d1e9788b235de996befb8d6344abd.tar.gz
otp-98ea0ed0985d1e9788b235de996befb8d6344abd.tar.bz2
otp-98ea0ed0985d1e9788b235de996befb8d6344abd.zip
Merge branch 'rickard/node-table-read-lock/OTP-12777'
* rickard/node-table-read-lock/OTP-12777: Only read lock node table when reading info
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_node_tables.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_node_tables.c b/erts/emulator/beam/erl_node_tables.c
index 6d827c6bda..964d830fc1 100644
--- a/erts/emulator/beam/erl_node_tables.c
+++ b/erts/emulator/beam/erl_node_tables.c
@@ -556,14 +556,14 @@ erts_node_table_size(void)
#endif
int lock = !ERTS_IS_CRASH_DUMPING;
if (lock)
- erts_smp_rwmtx_rwlock(&erts_node_table_rwmtx);
+ erts_smp_rwmtx_rlock(&erts_node_table_rwmtx);
#ifdef DEBUG
hash_get_info(&hi, &erts_node_table);
ASSERT(node_entries == hi.objs);
#endif
res = hash_table_sz(&erts_node_table) + node_entries*sizeof(ErlNode);
if (lock)
- erts_smp_rwmtx_rwunlock(&erts_node_table_rwmtx);
+ erts_smp_rwmtx_runlock(&erts_node_table_rwmtx);
return res;
}
@@ -572,10 +572,10 @@ erts_node_table_info(int to, void *to_arg)
{
int lock = !ERTS_IS_CRASH_DUMPING;
if (lock)
- erts_smp_rwmtx_rwlock(&erts_node_table_rwmtx);
+ erts_smp_rwmtx_rlock(&erts_node_table_rwmtx);
hash_info(to, to_arg, &erts_node_table);
if (lock)
- erts_smp_rwmtx_rwunlock(&erts_node_table_rwmtx);
+ erts_smp_rwmtx_runlock(&erts_node_table_rwmtx);
}
@@ -674,13 +674,13 @@ void erts_print_node_info(int to,
pnd.no_total = 0;
if (lock)
- erts_smp_rwmtx_rwlock(&erts_node_table_rwmtx);
+ erts_smp_rwmtx_rlock(&erts_node_table_rwmtx);
hash_foreach(&erts_node_table, print_node, (void *) &pnd);
if (pnd.no_sysname != 0) {
erts_print(to, to_arg, "\n");
}
if (lock)
- erts_smp_rwmtx_rwunlock(&erts_node_table_rwmtx);
+ erts_smp_rwmtx_runlock(&erts_node_table_rwmtx);
if(no_sysname)
*no_sysname = pnd.no_sysname;