diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2022-09-22 15:32:40 +0100 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2022-09-23 15:59:56 +0100 |
commit | d1babeb32de5dae8893c640bd925357b218d846c (patch) | |
tree | c5ee8e42e03e6a4caf2eb645d5f9b7a8bdbdb6e1 /nptl/nptl_setxid.c | |
parent | 8114b95cef10a5a1fc3e529ab8b3a75f56fe889a (diff) | |
download | glibc-d1babeb32de5dae8893c640bd925357b218d846c.tar.gz glibc-d1babeb32de5dae8893c640bd925357b218d846c.tar.xz glibc-d1babeb32de5dae8893c640bd925357b218d846c.zip |
Use C11 atomics instead of atomic_increment(_val)
Replace atomic_increment and atomic_increment_val with atomic_fetch_add_relaxed. One case in sem_post.c uses release semantics (see comment above it). The others are simple counters and do not protect any shared data from concurrent accesses. Passes regress on AArch64. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/nptl_setxid.c')
-rw-r--r-- | nptl/nptl_setxid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nptl/nptl_setxid.c b/nptl/nptl_setxid.c index e709822b9b..301809d200 100644 --- a/nptl/nptl_setxid.c +++ b/nptl/nptl_setxid.c @@ -163,7 +163,7 @@ setxid_signal_thread (struct xid_command *cmdp, struct pthread *t) /* If this failed, it must have had not started yet or else exited. */ if (!INTERNAL_SYSCALL_ERROR_P (val)) { - atomic_increment (&cmdp->cntr); + atomic_fetch_add_relaxed (&cmdp->cntr, 1); return 1; } else |