diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2022-09-09 14:22:26 +0100 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2022-09-09 14:22:26 +0100 |
commit | a364a3a7090b82ddd30e9209df2af56e781d51e4 (patch) | |
tree | 90412a565deeeb7aef54205159c0422af71771c9 /nscd/nscd_helper.c | |
parent | 53b251c9ff03ab59ba58fcddb9dc97c69f25fadc (diff) | |
download | glibc-a364a3a7090b82ddd30e9209df2af56e781d51e4.tar.gz glibc-a364a3a7090b82ddd30e9209df2af56e781d51e4.tar.xz glibc-a364a3a7090b82ddd30e9209df2af56e781d51e4.zip |
Use C11 atomics instead of atomic_decrement(_val)
Replace atomic_decrement and atomic_decrement_val with atomic_fetch_add_relaxed. Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'nscd/nscd_helper.c')
-rw-r--r-- | nscd/nscd_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c index 8e66fa2548..0651817a99 100644 --- a/nscd/nscd_helper.c +++ b/nscd/nscd_helper.c @@ -390,7 +390,7 @@ __nscd_get_mapping (request_type type, const char *key, struct mapped_database *oldval = *mappedp; *mappedp = result; - if (oldval != NULL && atomic_decrement_val (&oldval->counter) == 0) + if (oldval != NULL && atomic_fetch_add_relaxed (&oldval->counter, -1) == 1) __nscd_unmap (oldval); return result; |