@cryptotaxi247 / netdata-1 / commits / 6fb372b18

added compile option NETDATA_VERIFY_LOCKS to enable the locks

Costa Tsaousis (ktsaou) committed Mar 12, 2017 at 23:28 UTC 6fb372b18909cedbd8b7018caa9ed863928aff55
2 files changed +6 -6
src/rrdhost.c
+4 -4
@@ -380,7 +380,7 @@ void rrd_init(char *hostname) {
380 // RRDHOST - lock validations
381 // there are only used when NETDATA_INTERNAL_CHECKS is set
382
383 -void rrdhost_check_rdlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line) {
383 +void __rrdhost_check_rdlock(RRDHOST *host, const char *file, const char *function, const unsigned long line) {
384 debug(D_RRDHOST, "Checking read lock on host '%s'", host->hostname);
385
386 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
388 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);
389 }
390
391 -void rrdhost_check_wrlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line) {
391 +void __rrdhost_check_wrlock(RRDHOST *host, const char *file, const char *function, const unsigned long line) {
392 debug(D_RRDHOST, "Checking write lock on host '%s'", host->hostname);
393
394 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
396 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);
397 }
398
399 -void rrd_check_rdlock_int(const char *file, const char *function, const unsigned long line) {
399 +void __rrd_check_rdlock(const char *file, const char *function, const unsigned long line) {
400 debug(D_RRDHOST, "Checking read lock on all RRDs");
401
402 int ret = netdata_rwlock_trywrlock(&rrd_rwlock);
@@ -404,7 +404,7 @@ void rrd_check_rdlock_int(const char *file, const char *function, const unsigned
404 fatal("RRDs should be read-locked, but it are not, at function %s() at line %lu of file '%s'", function, line, file);
405 }
406
407 -void rrd_check_wrlock_int(const char *file, const char *function, const unsigned long line) {
407 +void __rrd_check_wrlock(const char *file, const char *function, const unsigned long line) {
408 debug(D_RRDHOST, "Checking write lock on all RRDs");
409
410 int ret = netdata_rwlock_tryrdlock(&rrd_rwlock);
src/rrdset.c
+2 -2
@@ -3,7 +3,7 @@
3
4 #define RRD_DEFAULT_GAP_INTERPOLATIONS 1
5
6 -void rrdset_check_rdlock_int(RRDSET *st, const char *file, const char *function, const unsigned long line) {
6 +void __rrdset_check_rdlock(RRDSET *st, const char *file, const char *function, const unsigned long line) {
7 debug(D_RRD_CALLS, "Checking read lock on chart '%s'", st->id);
8
9 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,
11 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);
12 }
13
14 -void rrdset_check_wrlock_int(RRDSET *st, const char *file, const char *function, const unsigned long line) {
14 +void __rrdset_check_wrlock(RRDSET *st, const char *file, const char *function, const unsigned long line) {
15 debug(D_RRD_CALLS, "Checking write lock on chart '%s'", st->id);
16
17 int ret = netdata_rwlock_tryrdlock(&st->rrdset_rwlock);