Skip to content

Commit 0d8ca55

Browse files
committed
Remove an atomic op from wait_sync_update
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
1 parent 1de67af commit 0d8ca55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opal/mca/threads/wait_sync.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ OPAL_DECLSPEC void wait_sync_global_wakeup_mt(int status);
144144
static inline void wait_sync_update(ompi_wait_sync_t *sync, int updates, int status)
145145
{
146146
if (OPAL_LIKELY(OPAL_SUCCESS == status)) {
147-
if (0 != (OPAL_THREAD_ADD_FETCH32(&sync->count, -updates))) {
147+
if (1 != sync->count && 0 != (OPAL_THREAD_ADD_FETCH32(&sync->count, -updates))) {
148148
return;
149149
}
150+
sync->count = 0;
150151
} else {
151152
/* this is an error path so just use the atomic */
152153
sync->status = status;

0 commit comments

Comments
 (0)