Skip to content

Commit

Permalink
Remove an atomic op from wait_sync_update
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
  • Loading branch information
devreal committed Nov 22, 2022
1 parent 31006fd commit ca79fa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opal/mca/threads/wait_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ OPAL_DECLSPEC void opal_threads_base_wait_sync_global_wakeup_mt(int status);
static inline void wait_sync_update(ompi_wait_sync_t *sync, int updates, int status)
{
if (OPAL_LIKELY(OPAL_SUCCESS == status)) {
if (0 != (OPAL_THREAD_ADD_FETCH32(&sync->count, -updates))) {
if (1 != sync->count && 0 != (OPAL_THREAD_ADD_FETCH32(&sync->count, -updates))) {
return;
}
sync->count = 0;
} else {
/* this is an error path so just use the atomic */
sync->status = status;
Expand Down

0 comments on commit ca79fa1

Please sign in to comment.