mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch '1206-tcp-high-water-stats-fix-type' into 'master'
Avoid an extra atomic_load call when doing atomic_compare_exchange_loop See merge request isc-projects/bind9!2531
This commit is contained in:
commit
7c7f5884e5
1 changed files with 2 additions and 5 deletions
|
|
@ -157,15 +157,12 @@ void isc_stats_update_if_greater(isc_stats_t *stats,
|
|||
REQUIRE(ISC_STATS_VALID(stats));
|
||||
REQUIRE(counter < stats->ncounters);
|
||||
|
||||
isc_statscounter_t curr_value;
|
||||
|
||||
isc_statscounter_t curr_value =
|
||||
atomic_load_relaxed(&stats->counters[counter]);
|
||||
do {
|
||||
curr_value = atomic_load_explicit(&stats->counters[counter],
|
||||
memory_order_relaxed);
|
||||
if (curr_value >= value) {
|
||||
break;
|
||||
}
|
||||
|
||||
} while (!atomic_compare_exchange_strong(&stats->counters[counter],
|
||||
&curr_value,
|
||||
value));
|
||||
|
|
|
|||
Loading…
Reference in a new issue