Skip to content

Commit

Permalink
klitmus: Use WRITE_ONCE and READ_ONCE in place of deprecated ACCESS_ONCE
Browse files Browse the repository at this point in the history
         in "user" synchronization barrier

Suggested-by: Andrea Parri
  • Loading branch information
maranget committed Feb 16, 2018
1 parent bb6291e commit e87d7f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litmus/libdir/kbarrier-user.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
static inline void barrier_wait(int id,int i,int *b) {
if ((i % nthreads) == id) {
ACCESS_ONCE(*b) = 1;
WRITE_ONCE(*b,1);
smp_mb();
} else {
int _spin = 256;
for ( ; ; ) {
if (ACCESS_ONCE(*b) != 0) return;
if (READ_ONCE(*b) != 0) return;
if (--_spin <= 0) return;
cpu_relax();
}
Expand Down

0 comments on commit e87d7f9

Please sign in to comment.