Skip to content

Commit

Permalink
atomically load the metric reference count (#16687)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsaou committed Dec 29, 2023
1 parent e97a607 commit caf2721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/engine/metric.c
Expand Up @@ -132,7 +132,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 @@ -152,7 +152,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 caf2721

Please sign in to comment.