kerneltest/e32test/benchmark/thread.cpp
changeset 201 43365a9b78a3
parent 200 73ea206103e6
--- a/kerneltest/e32test/benchmark/thread.cpp	Wed Jun 23 19:44:53 2010 +0300
+++ b/kerneltest/e32test/benchmark/thread.cpp	Tue Jul 06 15:50:07 2010 +0300
@@ -165,8 +165,10 @@
 		BM_ERROR(r, r == KErrNone);
 		child.Logon(st);
 		BMProgram::SetAbsPriority(RThread(), KBMPriorityLow);
+		TRequestStatus threadRunning;
+		child.Rendezvous(threadRunning);
 		child.Resume();
-		User::After(1000); // Give the child thread a chance to run - killing it too earlier can leave the heap locked
+		User::WaitForRequest(threadRunning);	// Wait for the thread to run before killing it.
 		BMProgram::SetAbsPriority(RThread(), KBMPriorityHigh);
 		TBMTicks t1;
 		::bmTimer.Stamp(&t1);
@@ -183,6 +185,7 @@
 
 TInt Thread::KillingChild(TAny*)
 	{
+	RThread::Rendezvous(KErrNone);
 	User::WaitForAnyRequest();
 	return KErrNone;
 	}