Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
bc760310
Commit
bc760310
authored
Nov 06, 2019
by
Ondřej Surý
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid an extra atomic_load() call
parent
558d7ff5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
lib/isc/stats.c
lib/isc/stats.c
+2
-5
No files found.
lib/isc/stats.c
View file @
bc760310
...
...
@@ -159,15 +159,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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment