--- a/kerneltest/e32test/benchmark/sync.cpp Wed Jun 09 11:10:19 2010 +0300
+++ b/kerneltest/e32test/benchmark/sync.cpp Mon Jun 21 17:12:14 2010 +0300
@@ -272,10 +272,15 @@
void Sync::SemaphoreLatencyParent(TBMResult* aResult, TBMUInt64 aIter, TBool aRemote)
{
+ RSemaphore slSync;
+ TInt r = slSync.CreateGlobal(_L("slSync"), 0);
+ BM_ERROR(r, r == KErrNone);
+
SemaphoreLatencyArgs sl(aRemote, aIter);
MBMChild* child = sync.SpawnChild(&sl);
for (TBMUInt64 i = 0; i < aIter; ++i)
{
+ slSync.Signal();
sl.iSem.Wait();
TBMTicks now;
::bmTimer.Stamp(&now);
@@ -283,20 +288,27 @@
}
child->WaitChildExit();
sl.Close();
+ slSync.Close();
}
TInt Sync::SemaphoreLatencyChild(TAny* ptr)
{
+ RSemaphore slSync;
+ TInt r = slSync.OpenGlobal(_L("slSync"));
+ BM_ERROR(r, r == KErrNone);
+
SemaphoreLatencyArgs* sl = (SemaphoreLatencyArgs*) ptr;
sl->ChildOpen();
for (TBMUInt64 i = 0; i < sl->iIterationCount; ++i)
{
+ slSync.Wait();
TBMTicks sigTime;
::bmTimer.Stamp(&sigTime);
sl->iSem.Signal();
sl->ChildSignalTime(sigTime);
}
sl->ChildClose();
+ slSync.Close();
return KErrNone;
}
@@ -368,11 +380,16 @@
void Sync::ThreadSemaphoreLatencyParent(TBMResult* aResult, TBMUInt64 aIter, TBool aRemote)
{
+ RSemaphore tslSync;
+ TInt r = tslSync.CreateGlobal(_L("tslSync"), 0);
+ BM_ERROR(r, r == KErrNone);
+
ThreadSemaphoreLatencyArgs sl(aRemote, aIter);
MBMChild* child = sync.SpawnChild(&sl);
for (TBMUInt64 i = 0; i < aIter; ++i)
{
sl.iStatus = KRequestPending;
+ tslSync.Signal();
User::WaitForRequest(sl.iStatus);
BM_ASSERT(sl.iStatus == KErrNone);
TBMTicks now;
@@ -381,14 +398,20 @@
}
child->WaitChildExit();
sl.Close();
+ tslSync.Close();
}
TInt Sync::ThreadSemaphoreLatencyChild(TAny* ptr)
{
+ RSemaphore tslSync;
+ TInt r = tslSync.OpenGlobal(_L("tslSync"));
+ BM_ERROR(r, r == KErrNone);
+
ThreadSemaphoreLatencyArgs* sl = (ThreadSemaphoreLatencyArgs*) ptr;
sl->ChildOpen();
for (TBMUInt64 i = 0; i < sl->iIterationCount; ++i)
{
+ tslSync.Wait();
TRequestStatus* sptr = sl->iStatusPtr;
TBMTicks sigTime;
::bmTimer.Stamp(&sigTime);
@@ -396,6 +419,7 @@
sl->ChildSignalTime(sigTime);
}
sl->ChildClose();
+ tslSync.Close();
return KErrNone;
}