1
1

If we're locking the local window, need to wait until the lock returns.

This commit was SVN r26234.
Этот коммит содержится в:
Brian Barrett 2012-04-04 16:27:24 +00:00
родитель d1571b027a
Коммит d46d55ee9b
2 изменённых файлов: 20 добавлений и 0 удалений

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

@ -427,6 +427,16 @@ ompi_osc_pt2pt_module_lock(int lock_type,
ompi_comm_rank(module->p2p_comm), ompi_comm_rank(module->p2p_comm),
lock_type); lock_type);
if (ompi_comm_rank(module->p2p_comm) == target) {
/* If we're trying to lock locally, have to wait to actually
acquire the lock */
OPAL_THREAD_LOCK(&module->p2p_lock);
while (module->p2p_lock_received_ack == 0) {
opal_condition_wait(&module->p2p_cond, &module->p2p_lock);
}
OPAL_THREAD_UNLOCK(&module->p2p_lock);
}
/* return */ /* return */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

@ -524,6 +524,16 @@ ompi_osc_rdma_module_lock(int lock_type,
module->m_eager_send_active = false; module->m_eager_send_active = false;
if (ompi_comm_rank(module->m_comm) == target) {
/* If we're trying to lock locally, have to wait to actually
acquire the lock */
OPAL_THREAD_LOCK(&module->m_lock);
while (module->m_lock_received_ack == 0) {
opal_condition_wait(&module->m_cond, &module->m_lock);
}
OPAL_THREAD_UNLOCK(&module->m_lock);
}
/* return */ /* return */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }