From d521a2dd81b2fc82f17ab70ad67d77ed1f620830 Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Fri, 26 Mar 2004 16:14:13 +0000 Subject: [PATCH] fixed wait This commit was SVN r978. --- src/mca/pml/teg/src/pml_teg_wait.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mca/pml/teg/src/pml_teg_wait.c b/src/mca/pml/teg/src/pml_teg_wait.c index df06e68aed..b2f1e96b37 100644 --- a/src/mca/pml/teg/src/pml_teg_wait.c +++ b/src/mca/pml/teg/src/pml_teg_wait.c @@ -31,16 +31,17 @@ int mca_pml_teg_wait( /* give up and sleep until completion */ lam_mutex_lock(&mca_pml_teg.teg_request_lock); mca_pml_teg.teg_request_waiting++; - while(completed < 0) { + do { for(i=0; ireq_mpi_done == true) { completed = i; break; } - lam_condition_wait(&mca_pml_teg.teg_request_cond, &mca_pml_teg.teg_request_lock); } - } + if(completed < 0) + lam_condition_wait(&mca_pml_teg.teg_request_cond, &mca_pml_teg.teg_request_lock); + } while(completed < 0); mca_pml_teg.teg_request_waiting--; lam_mutex_unlock(&mca_pml_teg.teg_request_lock); }