Merge pull request #1416 from abouteiller/bugfix/recvcancelwiththreads
Fix a potential race condition in recv cancel
Этот коммит содержится в:
Коммит
f55a06da00
@ -103,13 +103,14 @@ static int mca_pml_ob1_recv_request_cancel(struct ompi_request_t* ompi_request,
|
|||||||
ompi_communicator_t *comm = request->req_recv.req_base.req_comm;
|
ompi_communicator_t *comm = request->req_recv.req_base.req_comm;
|
||||||
mca_pml_ob1_comm_t *ob1_comm = comm->c_pml_comm;
|
mca_pml_ob1_comm_t *ob1_comm = comm->c_pml_comm;
|
||||||
|
|
||||||
|
/* The rest should be protected behind the match logic lock */
|
||||||
|
OPAL_THREAD_LOCK(&ob1_comm->matching_lock);
|
||||||
if( true == request->req_match_received ) { /* way to late to cancel this one */
|
if( true == request->req_match_received ) { /* way to late to cancel this one */
|
||||||
|
OPAL_THREAD_UNLOCK(&ob1_comm->matching_lock);
|
||||||
assert( OMPI_ANY_TAG != ompi_request->req_status.MPI_TAG ); /* not matched isn't it */
|
assert( OMPI_ANY_TAG != ompi_request->req_status.MPI_TAG ); /* not matched isn't it */
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The rest should be protected behind the match logic lock */
|
|
||||||
OPAL_THREAD_LOCK(&ob1_comm->matching_lock);
|
|
||||||
if( request->req_recv.req_base.req_peer == OMPI_ANY_SOURCE ) {
|
if( request->req_recv.req_base.req_peer == OMPI_ANY_SOURCE ) {
|
||||||
opal_list_remove_item( &ob1_comm->wild_receives, (opal_list_item_t*)request );
|
opal_list_remove_item( &ob1_comm->wild_receives, (opal_list_item_t*)request );
|
||||||
} else {
|
} else {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user