From 41b6fc166e94765ddfe68f9feea3424b4a5ee41a Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Fri, 16 Sep 2005 20:45:25 +0000 Subject: [PATCH] setup callback before actually launching - otherwise this is a definate race condition This commit was SVN r7413. --- orte/tools/orted/orted.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/orte/tools/orted/orted.c b/orte/tools/orted/orted.c index cdcb4cf9d8..a1f5c02a8e 100644 --- a/orte/tools/orted/orted.c +++ b/orte/tools/orted/orted.c @@ -344,11 +344,6 @@ int main(int argc, char *argv[]) opal_setenv(var, "1", true, &environ); } - if (ORTE_SUCCESS != (ret = orte_rmgr.launch(orted_globals.bootproxy))) { - ORTE_ERROR_LOG(ret); - return ret; - } - /* setup the thread lock and condition variable */ OBJ_CONSTRUCT(&orted_globals.mutex, opal_mutex_t); OBJ_CONSTRUCT(&orted_globals.condition, opal_condition_t); @@ -360,13 +355,16 @@ int main(int argc, char *argv[]) return ret; } + if (ORTE_SUCCESS != (ret = orte_rmgr.launch(orted_globals.bootproxy))) { + ORTE_ERROR_LOG(ret); + return ret; + } + /* setup and enter the event monitor */ OPAL_THREAD_LOCK(&orted_globals.mutex); - while (false == orted_globals.exit_condition) { opal_condition_wait(&orted_globals.condition, &orted_globals.mutex); } - OPAL_THREAD_UNLOCK(&orted_globals.mutex); /* Finalize and clean up */