Skip to content

Commit b08fb3e

Browse files
Ralph Castainbwbarrett
authored andcommitted
Backport threadshift for show_help messages
Avoid threadlock between the ORTE and PMIx layers Signed-off-by: Ralph Castain <[email protected]>
1 parent 6efd638 commit b08fb3e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

orte/orted/pmix/pmix_server_gen.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,16 @@ void pmix_tool_connected_fn(opal_list_t *info,
811811

812812
}
813813

814+
static void lgcbfn(int sd, short args, void *cbdata)
815+
{
816+
orte_pmix_server_op_caddy_t *cd = (orte_pmix_server_op_caddy_t*)cbdata;
817+
818+
if (NULL != cd->cbfunc) {
819+
cd->cbfunc(cd->status, cd->cbdata);
820+
}
821+
OBJ_RELEASE(cd);
822+
}
823+
814824
void pmix_server_log_fn(opal_process_name_t *requestor,
815825
opal_list_t *info,
816826
opal_list_t *directives,
@@ -856,9 +866,13 @@ void pmix_server_log_fn(opal_process_name_t *requestor,
856866
}
857867
}
858868

859-
if (NULL != cbfunc) {
860-
cbfunc(OPAL_SUCCESS, cbdata);
861-
}
869+
/* we cannot directly execute the callback here
870+
* as it would threadlock - so shift to somewhere
871+
* safe */
872+
rc = ORTE_SUCCESS; // unused - silence compiler warning
873+
ORTE_PMIX_THREADSHIFT(requestor, NULL, rc,
874+
NULL, NULL, lgcbfn,
875+
cbfunc, cbdata);
862876
}
863877

864878
int pmix_server_job_ctrl_fn(const opal_process_name_t *requestor,

0 commit comments

Comments
 (0)