kerneltest/e32test/benchmark/thread.cpp
changeset 148 31ea0f8e3c99
parent 0 a41df078684a
child 176 af6ec97d9189
equal deleted inserted replaced
135:5e441a173c63 148:31ea0f8e3c99
   162 		RThread child;
   162 		RThread child;
   163 		TRequestStatus st;
   163 		TRequestStatus st;
   164 		TInt r = child.Create(KNullDesC, Thread::KillingChild, 0x2000, NULL, NULL);
   164 		TInt r = child.Create(KNullDesC, Thread::KillingChild, 0x2000, NULL, NULL);
   165 		BM_ERROR(r, r == KErrNone);
   165 		BM_ERROR(r, r == KErrNone);
   166 		child.Logon(st);
   166 		child.Logon(st);
       
   167 		BMProgram::SetAbsPriority(RThread(), KBMPriorityLow);
       
   168 		child.Resume();
       
   169 		User::After(1000); // Give the child thread a chance to run - killing it too earlier can leave the heap locked
   167 		BMProgram::SetAbsPriority(RThread(), KBMPriorityHigh);
   170 		BMProgram::SetAbsPriority(RThread(), KBMPriorityHigh);
   168 		child.Resume();
       
   169 		TBMTicks t1;
   171 		TBMTicks t1;
   170 		::bmTimer.Stamp(&t1);
   172 		::bmTimer.Stamp(&t1);
   171 		child.Kill(KErrCancel);
   173 		child.Kill(KErrCancel);
   172 		User::WaitForRequest(st);
   174 		User::WaitForRequest(st);
   173 		BM_ERROR(st.Int(), st == KErrCancel);
   175 		BM_ERROR(st.Int(), st == KErrCancel);