1
1

Ensure that we don't try to shut down a thread that is not [yet] there

(e.g., if you're excluding some devices, their destructors will be
invoked before the async event thread was setup for them).

This commit was SVN r18698.
Этот коммит содержится в:
Jeff Squyres 2008-06-20 19:30:51 +00:00
родитель ed17b51204
Коммит f4145fce7a

Просмотреть файл

@ -710,6 +710,10 @@ static void hca_construct(mca_btl_openib_hca_t *hca)
hca->xrc_fd = -1;
#endif
hca->qps = NULL;
#if OMPI_HAVE_THREADS
mca_btl_openib_component.async_pipe[0] =
mca_btl_openib_component.async_pipe[1] = -1;
#endif
OBJ_CONSTRUCT(&hca->hca_lock, opal_mutex_t);
OBJ_CONSTRUCT(&hca->send_free_control, ompi_free_list_t);
}
@ -734,7 +738,8 @@ static void hca_destruct(mca_btl_openib_hca_t *hca)
}
#endif
/* signaling to async_tread to stop poll for this hca */
if(mca_btl_openib_component.use_async_event_thread) {
if (mca_btl_openib_component.use_async_event_thread &&
-1 != mca_btl_openib_component.async_pipe[1]) {
int hca_to_remove;
hca_to_remove = -(hca->ib_dev_context->async_fd);
if (write(mca_btl_openib_component.async_pipe[1], &hca_to_remove,