Skip to content

Commit

Permalink
Yield thread's timeslice when spin-waiting for barrier completion
Browse files Browse the repository at this point in the history
Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Jul 24, 2024
1 parent 4f8305e commit 58c75f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/H5TSbarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ H5TS_barrier_wait(H5TS_barrier_t *barrier)
H5TS_atomic_fetch_add_uint(&barrier->generation, 1);
}
else {
/* Not the last thread, when for the generation to change */
/* Not the last thread, wait for the generation to change */
while (H5TS_atomic_load_uint(&barrier->generation) == my_generation)
;
H5TS_thread_yield();
}
}
#endif
Expand Down

0 comments on commit 58c75f3

Please sign in to comment.