1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

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>
This commit is contained in:
Wilco Dijkstra
2022-09-22 15:32:40 +01:00
parent 8114b95cef
commit d1babeb32d
9 changed files with 12 additions and 12 deletions

View File

@@ -192,7 +192,7 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
/* We depend on this value being correct and at least as high as the
real number of entries. */
atomic_increment (&table->head->nentries);
atomic_fetch_add_relaxed (&table->head->nentries, 1);
/* It does not matter that we are not loading the just increment
value, this is just for statistics. */