Merge pull request #5926 from hjelmn/v4.0.x_need_to_unblock_sigchld_in_some_cases
v4.0.x: Ensure SIGCHLD is unblocked
Этот коммит содержится в:
Коммит
24dae8609e
@ -28,6 +28,7 @@
|
|||||||
#include "orte/constants.h"
|
#include "orte/constants.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "opal/class/opal_ring_buffer.h"
|
#include "opal/class/opal_ring_buffer.h"
|
||||||
#include "orte/mca/mca.h"
|
#include "orte/mca/mca.h"
|
||||||
@ -225,6 +226,7 @@ static int orte_odls_base_open(mca_base_open_flag_t flags)
|
|||||||
int rc, i, rank;
|
int rc, i, rank;
|
||||||
orte_namelist_t *nm;
|
orte_namelist_t *nm;
|
||||||
bool xterm_hold;
|
bool xterm_hold;
|
||||||
|
sigset_t unblock;
|
||||||
|
|
||||||
ORTE_CONSTRUCT_LOCK(&orte_odls_globals.lock);
|
ORTE_CONSTRUCT_LOCK(&orte_odls_globals.lock);
|
||||||
orte_odls_globals.lock.active = false; // start with nobody having the thread
|
orte_odls_globals.lock.active = false; // start with nobody having the thread
|
||||||
@ -243,6 +245,17 @@ static int orte_odls_base_open(mca_base_open_flag_t flags)
|
|||||||
OBJ_CONSTRUCT(&orte_odls_globals.xterm_ranks, opal_list_t);
|
OBJ_CONSTRUCT(&orte_odls_globals.xterm_ranks, opal_list_t);
|
||||||
orte_odls_globals.xtermcmd = NULL;
|
orte_odls_globals.xtermcmd = NULL;
|
||||||
|
|
||||||
|
/* ensure that SIGCHLD is unblocked as we need to capture it */
|
||||||
|
if (0 != sigemptyset(&unblock)) {
|
||||||
|
return ORTE_ERROR;
|
||||||
|
}
|
||||||
|
if (0 != sigaddset(&unblock, SIGCHLD)) {
|
||||||
|
return ORTE_ERROR;
|
||||||
|
}
|
||||||
|
if (0 != sigprocmask(SIG_UNBLOCK, &unblock, NULL)) {
|
||||||
|
return ORTE_ERR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
/* check if the user requested that we display output in xterms */
|
/* check if the user requested that we display output in xterms */
|
||||||
if (NULL != orte_xterm) {
|
if (NULL != orte_xterm) {
|
||||||
/* construct a list of ranks to be displayed */
|
/* construct a list of ranks to be displayed */
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user