videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/VCXTestMessageWait.cpp
changeset 3 bdf78597b41c
parent 0 822a42b6c3f1
child 15 6c92a12abac0
equal deleted inserted replaced
2:12f9acf7a934 3:bdf78597b41c
   203             User::LeaveIfError( iError );
   203             User::LeaveIfError( iError );
   204             }
   204             }
   205         }
   205         }
   206     else
   206     else
   207         {
   207         {
       
   208         iWaitStarted = EFalse;
       
   209         
   208         // Nothing to wait for.
   210         // Nothing to wait for.
   209         iTimeoutTimer->CancelTimer();
   211         iTimeoutTimer->CancelTimer();
   210         
   212         
   211         // Not blocking, inform client with callback.
   213         // Not blocking, inform client with callback.
   212         if( !aDoBlock )
   214         if( !aDoBlock )
   243 // CVCXTestMessageWait::ReceiveMessage
   245 // CVCXTestMessageWait::ReceiveMessage
   244 // -----------------------------------------------------------------------------
   246 // -----------------------------------------------------------------------------
   245 //
   247 //
   246 EXPORT_C void CVCXTestMessageWait::ReceiveMessage( TInt32 aMsg, TInt aError )
   248 EXPORT_C void CVCXTestMessageWait::ReceiveMessage( TInt32 aMsg, TInt aError )
   247 	{
   249 	{
       
   250     if( !iWaitStarted )
       
   251         {
       
   252         VCXLOGLO1("CVCXTestMessageWait::ReceiveMessage: Wait not active.");
       
   253         return;
       
   254         }
       
   255 
   248     VCXLOGLO1(">>>CVCXTestMessageWait::ReceiveMessage");
   256     VCXLOGLO1(">>>CVCXTestMessageWait::ReceiveMessage");
   249 
   257 
   250     if( aError != KErrNone )
   258     if( aError != KErrNone )
   251         {
   259         {
       
   260         iWaitStarted = EFalse;
   252         if( iActiveWaitBlocking->IsWaiting() )
   261         if( iActiveWaitBlocking->IsWaiting() )
   253             {
   262             {
   254             iError = aError;
   263             iError = aError;
   255             iActiveWaitBlocking->Stop();
   264             iActiveWaitBlocking->Stop();
   256             }
   265             }
   289                 }
   298                 }
   290             }
   299             }
   291         
   300         
   292         if( iWaitedMessages.Count() <= 0 )
   301         if( iWaitedMessages.Count() <= 0 )
   293             {
   302             {
       
   303             iWaitStarted = EFalse;
   294             // Stop wait.
   304             // Stop wait.
   295             if( iActiveWaitBlocking->IsWaiting() )
   305             if( iActiveWaitBlocking->IsWaiting() )
   296                 {
   306                 {
   297                 iError = KErrNone;
   307                 iError = KErrNone;
   298                 iActiveWaitBlocking->Stop();
   308                 iActiveWaitBlocking->Stop();
   325             iCoolingDown = EFalse;
   335             iCoolingDown = EFalse;
   326             }
   336             }
   327         else
   337         else
   328         if( iWaitedMessages.Count() > 0 )
   338         if( iWaitedMessages.Count() > 0 )
   329             {
   339             {
       
   340             iWaitStarted = EFalse;
   330             VCXLOGLO2("CVCXTestMessageWait:: Timeout. Messages left: %d", iWaitedMessages.Count());
   341             VCXLOGLO2("CVCXTestMessageWait:: Timeout. Messages left: %d", iWaitedMessages.Count());
   331             if( iActiveWaitBlocking->IsWaiting() )
   342             if( iActiveWaitBlocking->IsWaiting() )
   332                 {
   343                 {
   333                 iActiveWaitBlocking->Stop();
   344                 iActiveWaitBlocking->Stop();
   334                 iError = KErrTimedOut;
   345                 iError = KErrTimedOut;