Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions ompi/request/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,27 +375,25 @@ static inline int ompi_request_free(ompi_request_t** request)
* Wait a particular request for completion
*/

#if OPAL_ENABLE_MULTI_THREADS
static inline void ompi_request_wait_completion(ompi_request_t *req)
{
ompi_wait_sync_t sync;
WAIT_SYNC_INIT(&sync, 1);
if (opal_using_threads ()) {
ompi_wait_sync_t sync;
WAIT_SYNC_INIT(&sync, 1);

if(OPAL_ATOMIC_CMPSET_PTR(&req->req_complete, REQUEST_PENDING, &sync)) {
SYNC_WAIT(&sync);
}
if(OPAL_ATOMIC_CMPSET_PTR(&req->req_complete, REQUEST_PENDING, &sync)) {
SYNC_WAIT(&sync);
}

assert(REQUEST_COMPLETE(req));
WAIT_SYNC_RELEASE(&sync);
}
#else
static inline void ompi_request_wait_completion(ompi_request_t *req)
{
while(!REQUEST_COMPLETE(req)) {
opal_progress();
assert(REQUEST_COMPLETE(req));
WAIT_SYNC_RELEASE(&sync);
} else {
while(!REQUEST_COMPLETE(req)) {
opal_progress();
}
}
}
#endif

/**
* Signal or mark a request as complete. If with_signal is true this will
* wake any thread pending on the request. If with_signal is false, the
Expand Down