1
1

Fix a race condition when multiple threads do the "first send" to an endpoint simultaneously.

Этот коммит содержится в:
Aurélien Bouteiller 2016-05-05 09:03:20 -04:00
родитель 80f45925bc
Коммит 627a89bf71

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

@ -73,10 +73,11 @@ static inline mca_pml_ob1_comm_proc_t *mca_pml_ob1_peer_lookup (struct ompi_comm
if (OPAL_UNLIKELY(NULL == pml_comm->procs[rank])) {
OPAL_THREAD_LOCK(&pml_comm->proc_lock);
if (NULL == pml_comm->procs[rank]) {
pml_comm->procs[rank] = OBJ_NEW(mca_pml_ob1_comm_proc_t);
pml_comm->procs[rank]->ompi_proc = ompi_comm_peer_lookup (comm, rank);
OBJ_RETAIN(pml_comm->procs[rank]->ompi_proc);
mca_pml_ob1_comm_proc_t* proc = OBJ_NEW(mca_pml_ob1_comm_proc_t);
proc->ompi_proc = ompi_comm_peer_lookup (comm, rank);
OBJ_RETAIN(proc->ompi_proc);
opal_atomic_wmb ();
pml_comm->procs[rank] = proc;
}
OPAL_THREAD_UNLOCK(&pml_comm->proc_lock);
}