@@ -627,42 +627,24 @@ ompi_continuation_t *ompi_continue_cont_create(
627
627
/* signal that the continuation request has a new continuation */
628
628
OBJ_RETAIN (cont_req );
629
629
630
- opal_atomic_lock (& cont_req -> cont_lock );
630
+ if (using_threads ) {
631
+ opal_atomic_lock (& cont_req -> cont_lock );
632
+ }
631
633
int prev_num_active = OPAL_THREAD_ADD_FETCH32 (& cont_req -> cont_num_active , 1 );
632
634
633
635
/* if the continuation request was completed we mark it pending here */
634
- //if (REQUEST_COMPLETE(&cont_req->super)) {
635
636
if (prev_num_active == 1 ) {
636
- //printf("PENDING cont_req %p cont %p\n", cont_req, cont);
637
- if (using_threads ) {
638
- //opal_atomic_lock(&cont_req->cont_lock);
639
- //if (REQUEST_COMPLETE(&cont_req->super)) {
640
- cont_req -> super .req_complete = REQUEST_PENDING ;
641
- cont_req -> super .req_complete_cb = NULL ;
642
- //}
643
- /* NOTE: atomic operations not required here, we're protected by the lock */
644
- //intptr_t tmp = (intptr_t)REQUEST_COMPLETED;
645
- //opal_atomic_compare_exchange_strong_ptr((intptr_t*)&cont_req->super.req_complete, &tmp, (intptr_t)REQUEST_PENDING);
646
- //tmp = (intptr_t)REQUEST_CB_COMPLETED;
647
- //opal_atomic_compare_exchange_strong_ptr((intptr_t*)&cont_req->super.req_complete_cb, &tmp, (intptr_t)NULL);
648
- //opal_atomic_unlock(&cont_req->cont_lock);
649
- } else {
650
- cont_req -> super .req_complete = REQUEST_PENDING ;
651
- cont_req -> super .req_complete_cb = NULL ;
652
- }
637
+ cont_req -> super .req_complete = REQUEST_PENDING ;
638
+ cont_req -> super .req_complete_cb = NULL ;
653
639
}
654
- opal_atomic_unlock (& cont_req -> cont_lock );
655
640
656
641
/* if we don't have the requests we cannot handle oob errors,
657
642
* so don't bother keeping the continuation around */
658
643
if (!req_volatile ) {
659
- if (using_threads ) {
660
- opal_atomic_lock (& cont_req -> cont_lock );
661
- }
662
644
opal_list_append (& cont_req -> cont_incomplete_list , & cont -> super .super );
663
- if ( using_threads ) {
664
- opal_atomic_unlock ( & cont_req -> cont_lock );
665
- }
645
+ }
646
+ if ( using_threads ) {
647
+ opal_atomic_unlock ( & cont_req -> cont_lock );
666
648
}
667
649
668
650
return cont ;
0 commit comments