Skip to content

Commit

Permalink
atomically load the metric reference count (#16687)
Browse files Browse the repository at this point in the history
(cherry picked from commit caf2721)
  • Loading branch information
ktsaou authored and tkatsoulas committed Feb 6, 2024
1 parent 75dd941 commit f9257f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/engine/metric.c
Expand Up @@ -127,7 +127,7 @@ static inline time_t mrg_metric_get_first_time_s_smart(MRG *mrg __maybe_unused,

static inline REFCOUNT metric_acquire(MRG *mrg __maybe_unused, METRIC *metric) {
size_t partition = metric->partition;
REFCOUNT expected = metric->refcount;
REFCOUNT expected = __atomic_load_n(&metric->refcount, __ATOMIC_RELAXED);
REFCOUNT refcount;

do {
Expand All @@ -147,7 +147,7 @@ static inline REFCOUNT metric_acquire(MRG *mrg __maybe_unused, METRIC *metric) {

static inline bool metric_release_and_can_be_deleted(MRG *mrg __maybe_unused, METRIC *metric) {
size_t partition = metric->partition;
REFCOUNT expected = metric->refcount;
REFCOUNT expected = __atomic_load_n(&metric->refcount, __ATOMIC_RELAXED);
REFCOUNT refcount;

do {
Expand Down

0 comments on commit f9257f7

Please sign in to comment.