btl/scif: fix hang at shutdown
a brand new dummy connection has to be used to properly trigger the main thread termination and avoid timeout in the main thread cmr=v1.8.2:reviewer=hjelmn This commit was SVN r31772.
Этот коммит содержится в:
родитель
3e19041425
Коммит
e836abfc51
@ -2,6 +2,8 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -117,7 +119,15 @@ static void *mca_btl_scif_connect_accept (void *arg)
|
||||
|
||||
rc = scif_poll (&pollepd, 1, -1);
|
||||
if (1 == rc) {
|
||||
if (SCIF_POLLIN != pollepd.revents || mca_btl_scif_module.exiting) {
|
||||
if (SCIF_POLLIN != pollepd.revents) {
|
||||
break;
|
||||
}
|
||||
if (mca_btl_scif_module.exiting) {
|
||||
/* accept the connection so scif_connect() does not timeout */
|
||||
struct scif_portID peer;
|
||||
scif_epd_t newepd;
|
||||
scif_accept(mca_btl_scif_module.scif_fd, &peer, &newepd, SCIF_ACCEPT_SYNC);
|
||||
scif_close(newepd);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -128,9 +128,12 @@ mca_btl_scif_module_finalize (struct mca_btl_base_module_t *btl)
|
||||
/* close the listening endpoint */
|
||||
if (-1 != mca_btl_scif_module.scif_fd) {
|
||||
/* wake up the scif thread */
|
||||
scif_connect (mca_btl_scif_module.scif_fd, &mca_btl_scif_module.port_id);
|
||||
scif_close (mca_btl_scif_module.scif_fd);
|
||||
scif_epd_t tmpfd;
|
||||
tmpfd = scif_open();
|
||||
scif_connect (tmpfd, &mca_btl_scif_module.port_id);
|
||||
pthread_join(mca_btl_scif_module.listen_thread, NULL);
|
||||
scif_close(tmpfd);
|
||||
scif_close (mca_btl_scif_module.scif_fd);
|
||||
}
|
||||
|
||||
mca_btl_scif_module.scif_fd = -1;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user