struct config_option *values;
avl_tree_lock values_index;
- pthread_mutex_t mutex; // this locks only the writers, to ensure atomic updates
+ netdata_mutex_t mutex; // this locks only the writers, to ensure atomic updates
// readers are protected using the rwlock in avl_tree_lock
};
struct config netdata_config = {
.sections = NULL,
- .mutex = PTHREAD_MUTEX_INITIALIZER,
+ .mutex = NETDATA_MUTEX_INITIALIZER,
.index = {
{ NULL, appconfig_section_compare },
AVL_LOCK_INITIALIZER
struct config stream_config = {
.sections = NULL,
- .mutex = PTHREAD_MUTEX_INITIALIZER,
+ .mutex = NETDATA_MUTEX_INITIALIZER,
.index = {
{ NULL, appconfig_section_compare },
AVL_LOCK_INITIALIZER
// locking
static inline void appconfig_wrlock(struct config *root) {
- pthread_mutex_lock(&root->mutex);
+ netdata_mutex_lock(&root->mutex);
}
static inline void appconfig_unlock(struct config *root) {
- pthread_mutex_unlock(&root->mutex);
+ netdata_mutex_unlock(&root->mutex);
}
static inline void config_section_wrlock(struct section *co) {
- pthread_mutex_lock(&co->mutex);
+ netdata_mutex_lock(&co->mutex);
}
static inline void config_section_unlock(struct section *co) {
- pthread_mutex_unlock(&co->mutex);
+ netdata_mutex_unlock(&co->mutex);
}
{
struct config_option *cv;
- debug(D_CONFIG, "request to set config in section '%s', name '%s', value '%s'", section, name, value);
+ debug(D_CONFIG, "request to set default config in section '%s', name '%s', value '%s'", section, name, value);
struct section *co = appconfig_section_find(root, section);
if(!co) return appconfig_set(root, section, name, value);
if(only_changed && !changed) continue;
if(!used) {
- buffer_sprintf(wb, "\n# node '%s' is not used.", co->name);
+ buffer_sprintf(wb, "\n# section '%s' is not used.", co->name);
}
buffer_sprintf(wb, "\n[%s]\n", co->name);