kerneltest/e32test/mmu/t_shbuf.cpp
changeset 109 b3a1d9898418
parent 90 947f0dc9f7a8
child 201 43365a9b78a3
--- a/kerneltest/e32test/mmu/t_shbuf.cpp	Mon May 03 13:47:38 2010 +0300
+++ b/kerneltest/e32test/mmu/t_shbuf.cpp	Fri May 14 17:13:29 2010 +0300
@@ -39,6 +39,8 @@
 
 const TInt* PtrBufSize;
 
+static TInt ThreadCounter = 0;
+
 RShBufTestChannel Ldd;
 
 _LIT(KTestSlave, "SLAVE");
@@ -1872,9 +1874,9 @@
  */
 void RequestLowSpacePanic(RShPool& aPool, TUint aThreshold1, TUint aThreshold2, TTestLowSpaceType aType, TInt aLine)
 	{
-	static TInt count = 0;
-	count++;
-	test.Printf(_L("RequestLowSpacePanic@%d(%d)\n"), aLine, count);
+	TBuf<40> threadname;
+	threadname.Format(_L("ThreadLowSpacePanic%d"), ++ThreadCounter);
+	test.Printf(_L("RequestLowSpacePanic@%d(%S)\n"), aLine, &threadname);
 	TBool jit = User::JustInTime();
 	User::SetJustInTime(EFalse);
 	TInt expectedpaniccode = KErrNone;	// Initialised to silence compiler warnings
@@ -1897,8 +1899,6 @@
 	RThread threadpanic;
 	TRequestStatus threadpanicrs;
 	TInt r;
-	TBuf<30> threadname;
-	threadname.Format(_L("ThreadLowSpacePanic%d"), count);
 	r = threadpanic.Create(threadname, ThreadLowSpacePanic, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &targs);
 	test_KErrNone(r);
 	threadpanic.Logon(threadpanicrs);
@@ -1925,7 +1925,10 @@
 	test_KErrNone(r);
 	RThread thread;
 	TRequestStatus threadrs;
-	r = thread.Create(_L("ThreadNotifications"), ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
+	TBuf<40> threadname;
+	threadname.Format(_L("ThreadNotifications%d"), ++ThreadCounter);
+	test.Printf(_L("Create %S\n"), &threadname);
+	r = thread.Create(threadname, ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
 	test_KErrNone(r);
 	thread.SetPriority(EPriorityMore);
 	thread.Logon(threadrs);
@@ -2077,9 +2080,13 @@
 	RSemaphore sem;
 	r = sem.CreateGlobal(KTestLowSpaceSemaphore, 0);
 	test_KErrNone(r);
+
+	TBuf<40> threadname;
+	threadname.Format(_L("ThreadCancelNotifications%d"), ++ThreadCounter);
+	test.Printf(_L("Create %S\n"), &threadname);
 	RThread thread;
 	TRequestStatus threadrs;
-	r = thread.Create(_L("ThreadCancelNotifications"), ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
+	r = thread.Create(threadname, ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
 	test_KErrNone(r);
 	thread.SetPriority(EPriorityLess);
 	thread.Logon(threadrs);