From 6fb372b18909cedbd8b7018caa9ed863928aff55 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sun, 12 Mar 2017 23:28:05 +0200 Subject: [PATCH] added compile option NETDATA_VERIFY_LOCKS to enable the locks --- src/rrdhost.c | 8 ++++---- src/rrdset.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rrdhost.c b/src/rrdhost.c index 3ec71b58..fd7f3524 100644 --- a/src/rrdhost.c +++ b/src/rrdhost.c @@ -380,7 +380,7 @@ void rrd_init(char *hostname) { // RRDHOST - lock validations // there are only used when NETDATA_INTERNAL_CHECKS is set -void rrdhost_check_rdlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line) { +void __rrdhost_check_rdlock(RRDHOST *host, const char *file, const char *function, const unsigned long line) { debug(D_RRDHOST, "Checking read lock on host '%s'", host->hostname); int ret = netdata_rwlock_trywrlock(&host->rrdhost_rwlock); @@ -388,7 +388,7 @@ void rrdhost_check_rdlock_int(RRDHOST *host, const char *file, const char *funct fatal("RRDHOST '%s' should be read-locked, but it is not, at function %s() at line %lu of file '%s'", host->hostname, function, line, file); } -void rrdhost_check_wrlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line) { +void __rrdhost_check_wrlock(RRDHOST *host, const char *file, const char *function, const unsigned long line) { debug(D_RRDHOST, "Checking write lock on host '%s'", host->hostname); int ret = netdata_rwlock_tryrdlock(&host->rrdhost_rwlock); @@ -396,7 +396,7 @@ void rrdhost_check_wrlock_int(RRDHOST *host, const char *file, const char *funct fatal("RRDHOST '%s' should be write-locked, but it is not, at function %s() at line %lu of file '%s'", host->hostname, function, line, file); } -void rrd_check_rdlock_int(const char *file, const char *function, const unsigned long line) { +void __rrd_check_rdlock(const char *file, const char *function, const unsigned long line) { debug(D_RRDHOST, "Checking read lock on all RRDs"); int ret = netdata_rwlock_trywrlock(&rrd_rwlock); @@ -404,7 +404,7 @@ void rrd_check_rdlock_int(const char *file, const char *function, const unsigned fatal("RRDs should be read-locked, but it are not, at function %s() at line %lu of file '%s'", function, line, file); } -void rrd_check_wrlock_int(const char *file, const char *function, const unsigned long line) { +void __rrd_check_wrlock(const char *file, const char *function, const unsigned long line) { debug(D_RRDHOST, "Checking write lock on all RRDs"); int ret = netdata_rwlock_tryrdlock(&rrd_rwlock); diff --git a/src/rrdset.c b/src/rrdset.c index 51950603..c847b969 100644 --- a/src/rrdset.c +++ b/src/rrdset.c @@ -3,7 +3,7 @@ #define RRD_DEFAULT_GAP_INTERPOLATIONS 1 -void rrdset_check_rdlock_int(RRDSET *st, const char *file, const char *function, const unsigned long line) { +void __rrdset_check_rdlock(RRDSET *st, const char *file, const char *function, const unsigned long line) { debug(D_RRD_CALLS, "Checking read lock on chart '%s'", st->id); int ret = netdata_rwlock_trywrlock(&st->rrdset_rwlock); @@ -11,7 +11,7 @@ void rrdset_check_rdlock_int(RRDSET *st, const char *file, const char *function, fatal("RRDSET '%s' should be read-locked, but it is not, at function %s() at line %lu of file '%s'", st->id, function, line, file); } -void rrdset_check_wrlock_int(RRDSET *st, const char *file, const char *function, const unsigned long line) { +void __rrdset_check_wrlock(RRDSET *st, const char *file, const char *function, const unsigned long line) { debug(D_RRD_CALLS, "Checking write lock on chart '%s'", st->id); int ret = netdata_rwlock_tryrdlock(&st->rrdset_rwlock); -- 2.39.2