datacommsserver/esockserver/ssock/ss_roles.cpp
branchRCL_3
changeset 11 98a7181d2ce7
parent 4 928ed51ddc43
child 15 51722b10598b
--- a/datacommsserver/esockserver/ssock/ss_roles.cpp	Sat Feb 20 00:01:55 2010 +0200
+++ b/datacommsserver/esockserver/ssock/ss_roles.cpp	Fri Mar 12 15:49:41 2010 +0200
@@ -1776,7 +1776,15 @@
 
 		if(err == KErrNone)
 			{
-		   	err = aRedShirt.Create(KNullDesC, RESockCleanupThreadFunction, 8192, static_cast<RHeap*>(heap), startupInfo);
+            // Attempt to create the RedShirt with a useful diagnostic name, to reduce the
+            // likelihood that time is wasted debugging a problem in it rather than in the original
+            // crashed worker
+            TBuf<KMaxKernelName> threadName;
+            _LIT(KNameFmt, "IgnoreMe_PostCrashCleanupHelper_%x");
+            TWorkerThreadRegister* deadInfo = aDeadWorker.WorkerProperties(aDeadWorker.WorkerId()); 
+            TUint deadThreadId = deadInfo? (TUint) deadInfo->iThreadId: User::TickCount();
+            threadName.Format(KNameFmt, deadThreadId);
+		   	err = aRedShirt.Create(threadName, RESockCleanupThreadFunction, 8192, static_cast<RHeap*>(heap), startupInfo);
 			}
 	   	// If any error occured, delete the startup info structure.
 	   	if(err != KErrNone)