genericopenlibs/openenvcore/backend/src/corebackend/localif.cpp
changeset 71 28ccaba883f4
parent 67 a1e347446159
--- a/genericopenlibs/openenvcore/backend/src/corebackend/localif.cpp	Fri Sep 17 19:25:42 2010 +0530
+++ b/genericopenlibs/openenvcore/backend/src/corebackend/localif.cpp	Wed Oct 13 19:39:18 2010 +0530
@@ -189,7 +189,6 @@
 			//Create Server Locks
 			err |= iSSLock.CreateLocal();
 			err |= iCSLock.CreateLocal();
-			err |= iIpcS.iLock.CreateLocal();
 			//Create TLDList Lock
 			err |= iTLDListLock.CreateLocal();
 			//Create the lock for Session Path
@@ -2191,7 +2190,7 @@
         { 
         timer.After(*reqarray[numReqs+arraycount], timeout); 
         // Wait for any request to complete 
-        CLocalSystemInterface::WaitForNRequest(*reqarray, numReqs+arraycount+1);     
+        CLocalSystemInterface::WaitForNRequest(reqarray, numReqs+arraycount+1);     
         if( (*reqarray[numReqs+arraycount]).Int() == KRequestPending) 
             {
             // The timer hasn't fired yet.
@@ -2206,7 +2205,7 @@
         } 
     else 
         { 
-        CLocalSystemInterface::WaitForNRequest(*reqarray, numReqs+arraycount);
+        CLocalSystemInterface::WaitForNRequest(reqarray, numReqs+arraycount);
         // Completion Status of one request has been gathered
         onedown = ETrue;
         }
@@ -3652,6 +3651,47 @@
 // Used in lieu of User::WaitForNRequest because of need to support pre-Argus builds
 // ---------------------------------------------------------------------------------
 //
+void CLocalSystemInterface::WaitForNRequest(TRequestStatus **aStatusArray, TInt aNum)
+	{
+	if (aNum)
+		{
+		// used to keep count of requests we have not been asked to wait for
+		TInt nOther = -1;
+		TBool done = EFalse;
+
+		do
+			{
+			++nOther;
+			User::WaitForAnyRequest();
+			for (TInt i = 0; i < aNum; ++i)
+				{
+				if ((*aStatusArray[i]).Int() != KRequestPending)
+					{
+					done = ETrue;
+					break;
+					}
+				}
+			} while (!done);
+
+		if (nOther)
+			{
+			// Adjust the thread's signal semaphore to account for the requests
+			// we were not asked to wait for.
+			RThread thrd;
+			for (TInt i = 0; i < nOther; ++i)
+				{
+				thrd.RequestSignal();
+				}
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------------
+// CLocalSystemInterface::WaitForNRequest
+// Wait for any one of the input asynchronous requests to complete
+// Used in lieu of User::WaitForNRequest because of need to support pre-Argus builds
+// ---------------------------------------------------------------------------------
+//
 void CLocalSystemInterface::WaitForNRequest(TRequestStatus aStatusArray[], TInt aNum)
 	{
 	if (aNum)