diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-12-03 16:30:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-03 16:30:43 +0200 |
commit | 1ccef511f0cc27cbc0aa46dff2ddc71928e8e304 (patch) | |
tree | 5a553da1732ac4165e55bb7dc0d8a5186c2bc2d6 /database | |
parent | 5061428c0effa811094190d255b1feb6b05901cc (diff) |
Fix __atomic_compare_exchange_n() atomics (#14085)
* proper use for atomic_compare_exchange()
* diskspace plugin is multi-threaded but it uses single threaded dictionaries
Diffstat (limited to 'database')
-rw-r--r-- | database/rrdcontext.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/database/rrdcontext.c b/database/rrdcontext.c index 9f2f29e754..28230c9066 100644 --- a/database/rrdcontext.c +++ b/database/rrdcontext.c @@ -29,7 +29,7 @@ #define WORKER_JOB_PP_QUEUE_SIZE 13 -typedef enum { +typedef enum __attribute__ ((__packed__)) { RRD_FLAG_NONE = 0, RRD_FLAG_DELETED = (1 << 0), // this is a deleted object (metrics, instances, contexts) RRD_FLAG_COLLECTED = (1 << 1), // this object is currently being collected @@ -115,6 +115,7 @@ typedef enum { static inline void rrd_flag_add_remove_atomic(RRD_FLAGS *flags, RRD_FLAGS check, RRD_FLAGS conditionally_add, RRD_FLAGS always_remove) { RRD_FLAGS expected, desired; + do { expected = *flags; |