Skip to content

Commit 4e760e3

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 b417307 commit 4e760e3

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
@@ -879,6 +879,16 @@ void pmix_tool_connected_fn(opal_list_t *info,
879879

880880
}
881881

882+
static void lgcbfn(int sd, short args, void *cbdata)
883+
{
884+
orte_pmix_server_op_caddy_t *cd = (orte_pmix_server_op_caddy_t*)cbdata;
885+
886+
if (NULL != cd->cbfunc) {
887+
cd->cbfunc(cd->status, cd->cbdata);
888+
}
889+
OBJ_RELEASE(cd);
890+
}
891+
882892
void pmix_server_log_fn(opal_process_name_t *requestor,
883893
opal_list_t *info,
884894
opal_list_t *directives,
@@ -924,9 +934,13 @@ void pmix_server_log_fn(opal_process_name_t *requestor,
924934
}
925935
}
926936

927-
if (NULL != cbfunc) {
928-
cbfunc(OPAL_SUCCESS, cbdata);
929-
}
937+
/* we cannot directly execute the callback here
938+
* as it would threadlock - so shift to somewhere
939+
* safe */
940+
rc = ORTE_SUCCESS; // unused - silence compiler warning
941+
ORTE_PMIX_THREADSHIFT(requestor, NULL, rc,
942+
NULL, NULL, lgcbfn,
943+
cbfunc, cbdata);
930944
}
931945

932946
int pmix_server_job_ctrl_fn(const opal_process_name_t *requestor,

0 commit comments

Comments
 (0)