diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-05-02 17:59:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 17:59:40 +0300 |
commit | b6d2a3662dfb683e9e95203ef3b21f8e31238b06 (patch) | |
tree | edfb6db2fa5cc932b36834e6b41017bc8182d8d8 /aclk | |
parent | db9b85a9cb9eac7b55a4145207ccc407e4064f4c (diff) |
Make atomics a hard-dep. (#12730)
They are used extensively throughout our code base, and not having
support for them does not generate a thread-safe agent.
Diffstat (limited to 'aclk')
-rw-r--r-- | aclk/aclk_util.c | 11 | ||||
-rw-r--r-- | aclk/aclk_util.h | 6 |
2 files changed, 0 insertions, 17 deletions
diff --git a/aclk/aclk_util.c b/aclk/aclk_util.c index 5576a865a2..430925460b 100644 --- a/aclk/aclk_util.c +++ b/aclk/aclk_util.c @@ -65,17 +65,6 @@ int aclk_env_has_capa(const char *capa) #ifdef ACLK_LOG_CONVERSATION_DIR volatile int aclk_conversation_log_counter = 0; -#if !defined(HAVE_C___ATOMIC) -netdata_mutex_t aclk_conversation_log_mutex = NETDATA_MUTEX_INITIALIZER; -int aclk_get_conv_log_next() -{ - int ret; - netdata_mutex_lock(&aclk_conversation_log_mutex); - ret = aclk_conversation_log_counter++; - netdata_mutex_unlock(&aclk_conversation_log_mutex); - return ret; -} -#endif #endif #define ACLK_TOPIC_PREFIX "/agent/" diff --git a/aclk/aclk_util.h b/aclk/aclk_util.h index 7a72020763..fb0492ac8a 100644 --- a/aclk/aclk_util.h +++ b/aclk/aclk_util.h @@ -99,13 +99,7 @@ void free_topic_cache(void); #ifdef ACLK_LOG_CONVERSATION_DIR extern volatile int aclk_conversation_log_counter; -#if defined(HAVE_C___ATOMIC) #define ACLK_GET_CONV_LOG_NEXT() __atomic_fetch_add(&aclk_conversation_log_counter, 1, __ATOMIC_SEQ_CST) -#else -extern netdata_mutex_t aclk_conversation_log_mutex; -int aclk_get_conv_log_next(); -#define ACLK_GET_CONV_LOG_NEXT() aclk_get_conv_log_next() -#endif #endif unsigned long int aclk_tbeb_delay(int reset, int base, unsigned long int min, unsigned long int max); |