Skip to content

Commit d2abff5

Browse files
committed
Fix race condition during BTL TCP tear-down.
bot:label:bug bot:assign:@hjelmn
1 parent 8762574 commit d2abff5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

opal/mca/btl/tcp/btl_tcp_component.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ static int mca_btl_tcp_component_close(void)
414414
}
415415
#endif
416416

417-
/* cleanup any pending events */
418-
MCA_BTL_TCP_CRITICAL_SECTION_ENTER(&mca_btl_tcp_component.tcp_lock);
417+
/* remove all pending events. Do not lock the tcp_events list as
418+
the event themselves will unregister during the destructor. */
419419
for(item = opal_list_get_first(&mca_btl_tcp_component.tcp_events);
420420
item != opal_list_get_end(&mca_btl_tcp_component.tcp_events);
421421
item = next) {
@@ -424,7 +424,6 @@ static int mca_btl_tcp_component_close(void)
424424
opal_event_del(&event->event);
425425
OBJ_RELEASE(event);
426426
}
427-
MCA_BTL_TCP_CRITICAL_SECTION_LEAVE(&mca_btl_tcp_component.tcp_lock);
428427

429428
/* release resources */
430429
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_procs);

0 commit comments

Comments
 (0)