1
1

Merge pull request #6320 from thananon/pr/wait_sync_fix

opal/threads: reverted #6199
Этот коммит содержится в:
Thananon Patinyasakdikul 2019-01-30 15:31:27 -05:00 коммит произвёл GitHub
родитель 2c8f745d8d 56d3e0a43d
Коммит 58244b36d1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -47,7 +47,6 @@ int ompi_sync_wait_mt(ompi_wait_sync_t *sync)
}
/* Insert sync on the list of pending synchronization constructs */
if (num_thread_in_progress >= opal_max_thread_in_progress) {
OPAL_THREAD_LOCK(&wait_sync_lock);
if( NULL == wait_sync_list ) {
sync->next = sync->prev = sync;
@ -59,7 +58,6 @@ int ompi_sync_wait_mt(ompi_wait_sync_t *sync)
wait_sync_list->prev = sync;
}
OPAL_THREAD_UNLOCK(&wait_sync_lock);
}
/**
* If we are not responsible for progresing, go silent until something worth noticing happen:
@ -91,13 +89,8 @@ int ompi_sync_wait_mt(ompi_wait_sync_t *sync)
}
OPAL_THREAD_ADD_FETCH32(&num_thread_in_progress, -1);
if (NULL != wait_sync_list) {
assert(sync == wait_sync_list);
}
i_am_done:
/* My sync is now complete. Trim the list: remove self, wake next */
if (num_thread_in_progress >= opal_max_thread_in_progress) {
OPAL_THREAD_LOCK(&wait_sync_lock);
sync->prev->next = sync->next;
sync->next->prev = sync->prev;
@ -108,6 +101,6 @@ int ompi_sync_wait_mt(ompi_wait_sync_t *sync)
WAIT_SYNC_PASS_OWNERSHIP(wait_sync_list);
}
OPAL_THREAD_UNLOCK(&wait_sync_lock);
}
return (0 == sync->status) ? OPAL_SUCCESS : OPAL_ERROR;
}