@@ -765,29 +765,39 @@ static int mca_btl_base_am_rdma_progress(void)
765765 return 0 ;
766766 }
767767
768- OPAL_THREAD_SCOPED_LOCK (& default_module .mutex , ({
769- mca_btl_base_rdma_operation_t * operation , * next ;
770- OPAL_LIST_FOREACH_SAFE (operation , next , & default_module .queued_responses ,
771- mca_btl_base_rdma_operation_t ) {
772- mca_btl_base_rdma_retry_operation (operation );
773- }
774- }));
775-
776- OPAL_THREAD_SCOPED_LOCK (& default_module .mutex , ({
777- mca_btl_base_am_rdma_queued_descriptor_t * descriptor , * next ;
778- OPAL_LIST_FOREACH_SAFE (descriptor , next , & default_module .queued_initiator_descriptors ,
779- mca_btl_base_am_rdma_queued_descriptor_t ) {
780- mca_btl_base_rdma_context_t * context = (mca_btl_base_rdma_context_t * )
781- descriptor -> descriptor -> des_context ;
782- int ret = descriptor -> btl -> btl_send (descriptor -> btl , descriptor -> endpoint ,
783- descriptor -> descriptor ,
784- mca_btl_base_rdma_tag (context -> type ));
785- if (OPAL_SUCCESS == ret ) {
786- opal_list_remove_item (& default_module .queued_initiator_descriptors ,
787- & descriptor -> super );
788- }
789- }
790- }));
768+ // It's a little cleaner, stylistically, to make the multi-line
769+ // ACTION argument to OPAL_THREAD_SCOPED_LOCK be a macro itself
770+ // (vs. using continuation characters in the use of
771+ // OPAL_THREAD_SCOPED_LOCK).
772+ #define ACTION1 \
773+ mca_btl_base_rdma_operation_t *operation, *next; \
774+ OPAL_LIST_FOREACH_SAFE (operation, next, \
775+ &default_module.queued_responses, \
776+ mca_btl_base_rdma_operation_t) { \
777+ mca_btl_base_rdma_retry_operation(operation); \
778+ }
779+
780+ OPAL_THREAD_SCOPED_LOCK (& default_module .mutex , ACTION1 );
781+
782+ #define ACTION2 \
783+ mca_btl_base_am_rdma_queued_descriptor_t *descriptor, *next; \
784+ OPAL_LIST_FOREACH_SAFE (descriptor, next, \
785+ &default_module.queued_initiator_descriptors, \
786+ mca_btl_base_am_rdma_queued_descriptor_t) { \
787+ mca_btl_base_rdma_context_t *context = \
788+ (mca_btl_base_rdma_context_t *) \
789+ descriptor->descriptor->des_context; \
790+ int ret = descriptor->btl->btl_send(descriptor->btl, \
791+ descriptor->endpoint, \
792+ descriptor->descriptor, \
793+ mca_btl_base_rdma_tag(context->type)); \
794+ if (OPAL_SUCCESS == ret) { \
795+ opal_list_remove_item(&default_module.queued_initiator_descriptors, \
796+ &descriptor->super); \
797+ } \
798+ }
799+
800+ OPAL_THREAD_SCOPED_LOCK (& default_module .mutex , ACTION2 );
791801
792802 return 0 ;
793803}
0 commit comments