1
1

Ensure we cleanup DFS worker threads during finalize to avoid segfaulting in MCA param cleanup

This commit was SVN r27723.
Этот коммит содержится в:
Ralph Castain 2012-12-25 21:17:35 +00:00
родитель 64da742d5f
Коммит d1163ebbf2
2 изменённых файлов: 5 добавлений и 12 удалений

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

@ -97,20 +97,12 @@ orte_dfs_base_module_t orte_dfs_orted_module = {
dfs_purge_file_maps
};
static void finalize_thread(int fd, short args, void *cbdata)
{
/* nothing to do here - we just need it to
* kick us out of the event_loop
*/
}
static void* worker_thread_engine(opal_object_t *obj);
typedef struct {
opal_object_t super;
int idx;
opal_event_base_t *event_base;
opal_event_t fin_ev;
bool active;
opal_thread_t thread;
} worker_thread_t;
@ -118,8 +110,6 @@ static void wt_const(worker_thread_t *ptr)
{
/* create an event base for this thread */
ptr->event_base = opal_event_base_create();
/* setup an event to finalize it */
opal_event_set(ptr->event_base, &ptr->fin_ev, -1, OPAL_EV_WRITE, finalize_thread, NULL);
/* construct the thread object */
OBJ_CONSTRUCT(&ptr->thread, opal_thread_t);
/* fork off a thread to progress it */
@ -132,8 +122,8 @@ static void wt_dest(worker_thread_t *ptr)
{
/* stop the thread */
ptr->active = false;
/* trigger the finalize event */
opal_event_active(&ptr->fin_ev, OPAL_EV_WRITE, 1);
/* break the loop */
opal_event_base_loopbreak(ptr->event_base);
/* wait for thread to exit */
opal_thread_join(&ptr->thread, NULL);
OBJ_DESTRUCT(&ptr->thread);

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

@ -628,6 +628,9 @@ int orte_ess_base_orted_finalize(void)
unlink(log_path);
}
/* close the dfs so its threads can exit */
orte_dfs_base_close();
/* make sure our local procs are dead */
orte_odls.kill_local_procs(NULL);