File tree 1 file changed +15
-12
lines changed 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -417,21 +417,24 @@ static inline int ompi_request_free(ompi_request_t** request)
417
417
418
418
static inline void ompi_request_wait_completion (ompi_request_t * req )
419
419
{
420
- if (opal_using_threads () && !REQUEST_COMPLETE (req )) {
421
- void * _tmp_ptr = REQUEST_PENDING ;
422
- ompi_wait_sync_t sync ;
420
+ if (opal_using_threads ()) {
421
+ if (!REQUEST_COMPLETE (req )) {
422
+ void * _tmp_ptr = REQUEST_PENDING ;
423
+ ompi_wait_sync_t sync ;
423
424
424
- WAIT_SYNC_INIT (& sync , 1 );
425
+ WAIT_SYNC_INIT (& sync , 1 );
425
426
426
- if (OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_PTR (& req -> req_complete , & _tmp_ptr , & sync )) {
427
- SYNC_WAIT (& sync );
428
- } else {
429
- /* completed before we had a chance to swap in the sync object */
430
- WAIT_SYNC_SIGNALLED (& sync );
431
- }
427
+ if (OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_PTR (& req -> req_complete , & _tmp_ptr , & sync )) {
428
+ SYNC_WAIT (& sync );
429
+ } else {
430
+ /* completed before we had a chance to swap in the sync object */
431
+ WAIT_SYNC_SIGNALLED (& sync );
432
+ }
432
433
433
- assert (REQUEST_COMPLETE (req ));
434
- WAIT_SYNC_RELEASE (& sync );
434
+ assert (REQUEST_COMPLETE (req ));
435
+ WAIT_SYNC_RELEASE (& sync );
436
+ }
437
+ opal_atomic_rmb ();
435
438
} else {
436
439
while (!REQUEST_COMPLETE (req )) {
437
440
opal_progress ();
You can’t perform that action at this time.
0 commit comments