Skip to content

Commit ca79fa1

Browse files
committed
Remove an atomic op from wait_sync_update
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 31006fd commit ca79fa1

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
@@ -145,9 +145,10 @@ OPAL_DECLSPEC void opal_threads_base_wait_sync_global_wakeup_mt(int status);
145145
static inline void wait_sync_update(ompi_wait_sync_t *sync, int updates, int status)
146146
{
147147
if (OPAL_LIKELY(OPAL_SUCCESS == status)) {
148-
if (0 != (OPAL_THREAD_ADD_FETCH32(&sync->count, -updates))) {
148+
if (1 != sync->count && 0 != (OPAL_THREAD_ADD_FETCH32(&sync->count, -updates))) {
149149
return;
150150
}
151+
sync->count = 0;
151152
} else {
152153
/* this is an error path so just use the atomic */
153154
sync->status = status;

0 commit comments

Comments
 (0)