diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2017-04-30 16:09:37 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2017-04-30 18:09:45 +0000 |
commit | bed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521 (patch) | |
tree | 519e5945ec0db75bfb50583539caa408a5819e87 /src/dictionary.c | |
parent | Temporarily disable signature checking (diff) | |
download | netdata-bed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521.tar.xz netdata-bed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521.zip |
New upstream version 1.6.0+dfsg
Diffstat (limited to 'src/dictionary.c')
-rw-r--r-- | src/dictionary.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/dictionary.c b/src/dictionary.c index fb9efeedb..512b4bbe6 100644 --- a/src/dictionary.c +++ b/src/dictionary.c @@ -31,21 +31,21 @@ static inline void NETDATA_DICTIONARY_STATS_ENTRIES_MINUS1(DICTIONARY *dict) { static inline void dictionary_read_lock(DICTIONARY *dict) { if(likely(dict->rwlock)) { // debug(D_DICTIONARY, "Dictionary READ lock"); - pthread_rwlock_rdlock(dict->rwlock); + netdata_rwlock_rdlock(dict->rwlock); } } static inline void dictionary_write_lock(DICTIONARY *dict) { if(likely(dict->rwlock)) { // debug(D_DICTIONARY, "Dictionary WRITE lock"); - pthread_rwlock_wrlock(dict->rwlock); + netdata_rwlock_wrlock(dict->rwlock); } } static inline void dictionary_unlock(DICTIONARY *dict) { if(likely(dict->rwlock)) { // debug(D_DICTIONARY, "Dictionary UNLOCK lock"); - pthread_rwlock_unlock(dict->rwlock); + netdata_rwlock_unlock(dict->rwlock); } } @@ -135,8 +135,8 @@ DICTIONARY *dictionary_create(uint8_t flags) { dict->stats = callocz(1, sizeof(struct dictionary_stats)); if(!(flags & DICTIONARY_FLAG_SINGLE_THREADED)) { - dict->rwlock = callocz(1, sizeof(pthread_rwlock_t)); - pthread_rwlock_init(dict->rwlock, NULL); + dict->rwlock = callocz(1, sizeof(netdata_rwlock_t)); + netdata_rwlock_init(dict->rwlock); } avl_init(&dict->values_index, name_value_compare); @@ -158,8 +158,10 @@ void dictionary_destroy(DICTIONARY *dict) { if(dict->stats) freez(dict->stats); - if(dict->rwlock) + if(dict->rwlock) { + netdata_rwlock_destroy(dict->rwlock); freez(dict->rwlock); + } freez(dict); } |