// Called from ProcessManagerThread
void QProcessActive::stop()
{
    QPROCESS_DEBUG_PRINT("QProcessActive::stop()");

    // Remove this from scheduler (also cancels the request)
    Deque();
}
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
COMASuplIMSIObserver::~COMASuplIMSIObserver() 
    {
    Deque();
    if(iSettings)
        delete iSettings;
    iStartupObserver.Close();
    }
Esempio n. 3
0
void NTimer::DoCancel0(TUint aState)
	{
	if (aState>ETransferring && aState<=EFinal)	// idle or transferring timers are not on a queue
		Deque();
	switch (aState)
		{
		case ETransferring:	// signal DFC to abort this iteration
			TheTimerQ.iTransferringCancelled=TRUE;
			break;
		case ECritical:		// signal DFC to abort this iteration
			TheTimerQ.iCriticalCancelled=TRUE;
			break;
		case EFinal:
			{
			// Need to clear bit in iPresent if both final queues now empty
			// NOTE: Timer might actually be on the completed queue rather than the final queue
			//		 but the check is harmless in any case.
			TInt i=iTriggerTime & NTimerQ::ETimerQMask;
			NTimerQ::STimerQ& q=TheTimerQ.iTickQ[i];
			if (q.iIntQ.IsEmpty() && q.iDfcQ.IsEmpty())
				TheTimerQ.iPresent &= ~(1<<i);
			break;
			}
		case EIdle:			// nothing to do
		case EHolding:		// just deque
		case EOrdered:		// just deque
			break;
		default:
			__NK_ASSERT_ALWAYS(0);
		}
	}
Esempio n. 4
0
/**	Destructor for new CAggregateItem.
	The destructor is private because only a CAggregateCollection should have the right to delete it
 */	
CAggregateItem::~CAggregateItem()
	{
	if (iIsAdded)
		{
		Deque();
		}
	}
Esempio n. 5
0
void CCommSession::CC32SessionCloseTimer::RunL()
	{
	Deque();
	if(iStatus == KErrNone)
		{
		C32LOG3(KC32Detail, _L8("CCommSession::CC32SessionCloseTimer::RunL session = %08x, DisconnectList = %08x. Will panic in debug."), iSession,	iSession->DisconnectPlayers());

		// After sending a sessionclose message to the player the timeout is set and it is in the order
		// of seconds. IF the player doesn't respond (may be unloaded during shutdown, see below comment
		// about stackable csy) and we get to this place, it is a defect and we'd like to catch that in
		// debug mode.

		// NOTE FOR STACKABLE CSY WRITERS
		// The session from csy loading another csy was not closed properly and hence when shutdown was
		// commanded, player CPMs unload, while the session remains. When EDisconnect message is received
		// by the comms server from kernel, session close message is sent to player CPM which has already
		// been unloaded and thus this timer expires. Ensure that all sessions from within csy is closed
		// before shutdown is called

		ASSERT(0);

		CC32Dealer* dealer = const_cast<CC32Dealer*>(&iSession->Dealer());
		dealer->DeleteSession(iSession);
		}
	}
// ---------------------------------------------------------------------------
// CUpnpTcpSessionReader::IssueRead
// Issues reading.
// ---------------------------------------------------------------------------
//
void CUpnpTcpSessionReader::IssueRead()
    {
    LOGS1( "%i, CUpnpTcpSessionReader::IssueRead", iSession.Id());
    // Initiate a new read from socket into iBuffer
    if( IsActive() )
        {
        LOGS1( "%i, PANIC: CUpnpTcpSessionReader::IssueRead!", iSession.Id() );
        User::Panic( _L("CUpnpTcpSessionReader is active" ), KErrGeneral );    
        } 
                                               
    if( iSession.IsConnected() )
        {
      	LOGS1( "%i, CUpnpTcpSessionReader::IssueRead"
          	, iSession.Id());
          	
        Deque();
        CActiveScheduler::Add(this);
          	
        iReceiveBuffer.Zero();
        
        StartCancelTimer();

        iSocket.RecvOneOrMore( iReceiveBuffer, 0, iStatus, iLen );   
        SetActive();
        }
    }
Esempio n. 7
0
void CLongTaskAO::RunL()
{
	// Place this AO at the end of the Scheduler... Check comment below (*)
	Deque();
	CActiveScheduler::Add( this );
	iCallBack.DoOneRoundL();
}
// -----------------------------------------------------------------------------
// COMASuplWapListener::~COMASuplWapListener
// Default destructor.
// -----------------------------------------------------------------------------
//
COMASuplWapListener::~COMASuplWapListener()
    {
    	if(iTrace)
    		iTrace->Trace( _L( "COMASuplWapListener::~COMASuplWapListener()" ), KTraceFileName, __LINE__ );    
    delete iMessage;
    delete iTrace;
    Deque();
    }	
// ---------------------------------------------------------------------------
// CUpnpHttpFileTransferWriter::WriteToSocket
// Writes data to socket
// ---------------------------------------------------------------------------
//
void CUpnpHttpFileTransferWriter::WriteToSocket()
    {
	Deque();
	CActiveScheduler::Add(this);  

	iSocket.Write(iSendPointer,iStatus);
	SetActive();
    }
CTLbsX3pRefLocWaiter::~CTLbsX3pRefLocWaiter()
	{
	if(IsActive())
		Cancel();
	
	if(IsAdded())
		Deque();		
	}
CTLbsX3pTransmitLocWaiter::~CTLbsX3pTransmitLocWaiter()
	{
	if(IsActive())
		Cancel();
	
	if(IsAdded())
		Deque();		
	}
Esempio n. 12
0
CIpUpsDialog::~CIpUpsDialog()
/**
Destructor
*/
   {
   Deque();
   iPromptDataDes.Close();
   delete iPromptData;
   iNotifier.Close();
   }
Esempio n. 13
0
TBuf<KImeiBufferSize> CTMGetImei::GetIMEI()
    {    
    CTelephony::TPhoneIdV1Pckg phoneIdPckg( iV1 );  
    
    iTelephony->GetPhoneId( iStatus, phoneIdPckg );
    SetActive();
    iAsw.Start();
    Deque();
    return iImei;       
    }
Esempio n. 14
0
TInt CDRMConsume::RunError( TInt /* aError */ )
#endif
{
    DRMLOG2( _L( "CDRMConsume::RunError: %d" ), aError );

    Deque();

    DRMLOG( _L( "CDRMConsume::RunError ok" ) );
    return 0;
}
Esempio n. 15
0
CStatController::~CStatController()
{
	// clear notification -- deque (and CActive destructor) will fail otherwise
	Notify( KErrCancel );
	Deque();

	// make sure the session is closed
	asserte( iSessionStatus == EIdle );
	asserte( iEngine == NULL );
	asserte( iTransport == NULL );
}
Esempio n. 16
0
CDisplayChannelTest::~CDisplayChannelTest()
/**
Destructor
*/
	{
	Deque();
	delete iAsyncHelper;
	iPixelFormats.Close();
	iResolutions.Close();
	iDisp.Close();	
	}
Esempio n. 17
0
int main()
{
	Init_Buffer();
	int test = 12;
	int MyTestArray[50] = { 30 };
	test = Send_Message(MyTestArray,19);
	Send_Done();
	
	Deque();

    return 0;
}
// ---------------------------------------------------------------------------
// CUpnpTcpSessionWriter::RetryWriteSucceed
//    
// ---------------------------------------------------------------------------
//    
void CUpnpTcpSessionWriter::RetryWriteSucceed()
	{
    if ( iSendBuffer.Length() == 0 ) return;
    
    Deque();
    CActiveScheduler::Add(this);  
    
    iSocket.Write( iSendBuffer, iStatus );
    iState = EWriting;         
    
    SetActive();
	}
Esempio n. 19
0
CWsClient::~CWsClient()
    {
    // neutralize us as an active object
    Deque(); // cancels and removes from scheduler
    // get rid of everything we allocated
    delete iGc;
    delete iScreen;
    delete iRedrawer;
    // destroy window group
    iGroup.Close(); // what's the difference between this and destroy?
    // finish with window server
    iWs.Close();
    }
Esempio n. 20
0
void CNaptTimer::Cancel()
	/**
	*
	* Remove Timer from Active Scheduler
	*
	**/
	{
	CTimer::DoCancel();
	if (IsAdded())
		{
        Deque();
        }
	}
Esempio n. 21
0
CStatTransportBT::~CStatTransportBT()
{
	// this will call cancel and remove the active object -- this will call cancel
	Deque(); 

	// cleanup the sockets
	switch( iBTTransportStatus ) {

	case EIdle:
	case EInitialised:
	case EDisconnected:
	case EError:
		break;

	case EConnected:
		iDataSocket.Shutdown( RSocket::EImmediate, iStatus );
		/* fall through */

	case EConnecting:
		iDataSocket.Close();
		iListenSocket.Shutdown( RSocket::EImmediate, iStatus );
		iListenSocket.Close();
		iSocketServ.Close();
		break;

	case EDisconnectingData:
	case EDisconnectingListen:
		;
		break;
	default:
		break;
	}

	if( iWrCommandData )
		{
		delete iWrCommandData;
		iWrCommandData = NULL;
		}

	if( iRecvBuffer )
		{
		delete iRecvBuffer;
		iRecvBuffer = NULL;
		}

	if( iRecvBufferPtr )
		{
		delete iRecvBufferPtr;
		iRecvBufferPtr = NULL;
		}
}
// ---------------------------------------------------------------------------
// CUpnpTcpSessionWriter::IssueWriteL
// Issues writing request if session is connected and the socket is not 
// already sending. If metioned conditions are not met then it queues the request.
// ---------------------------------------------------------------------------
//
void CUpnpTcpSessionWriter::IssueWriteL( const TDesC8& aBuffer )
    {
    LOGS1( "%i, CUpnpTcpSessionWriter::IssueWriteL(TDesC8&)", iSession.Id() );
    
    // Don't do anything because socket is already closed or we are writing already.
    if( iState == EDisconnected || (iSession.DownloadOngoing() ) 
        	|| (iSession.ShuttingDown() && iState != ENotConnected) )
        return;
    
    // If session not connected yet or is already sending then queue the write request
    if ( iState == ENotConnected || iState == EWriting )
        {
        CUpnpTcpWriteRequest* req = CUpnpTcpWriteRequest::NewL( aBuffer );
        CleanupStack::PushL(req);
        User::LeaveIfError(iWriteRequestList.Append( req ));
        CleanupStack::Pop();
        
        LOGS2(  "%i, CUpnpTcpSessionWriter::IssueWriteL - queue size=%i,"
                          , iSession.Id(), iWriteRequestList.Count() );
        return;
        }
    
    LOGS2( "%i, CUpnpTcpSessionWriter::IssueWriteL queue size=%i"
                     , iSession.Id() , iWriteRequestList.Count() );
                     
    // If session already connected then just prepare sending buffer and request 
    // send from socket

    iSendBuffer.Close();
    iSendBuffer.CreateL( aBuffer );
    
    /*if (Priority() == iInitialPriority)       
        SetPriority( iInitialPriority - 5);       
    else 
        SetPriority( iInitialPriority); */
        
    Deque();
    CActiveScheduler::Add(this);  
    
    iSocket.Write( iSendBuffer, iStatus );
    iState = EWriting;  
    
    SetActive();
    }
Esempio n. 23
0
int SendApiSendSize(void)
{
	int i = 0;
	int N = SENDSIZE;

	while (N > 0)
	{
		RingBuffer.temp_array[i] = Deque();
		if (RingBuffer.temp_array[i] == -2)
		{
			break;
		}
		N--;
		i++;
	}

	if (N == SENDSIZE)
	{
		return -2;
	}
	else if (N == 0)
	{
		RingBuffer.send_done = false;
		SendData(RingBuffer.temp_array, SENDSIZE);

		return 0;
	}
	else if (N != 0)
	{
		i = 0;
		while (RingBuffer.temp_array[i] != -2)
		{
			i++;
		}

		RingBuffer.send_done = false;
		SendData(RingBuffer.temp_array,i);

		return -3;
	}

	return -2;

}
Esempio n. 24
0
/**
CCntPplViewSession destructor.
*/
CCntPplViewSession::~CCntPplViewSession()
	{
	Deque();
	iContactsFile.RemoveSqlDBObserverL( *this );
    if ( iRSqlStatementReady )
        {
        iRSqlStatement.Close();
        iRSqlStatementReady = EFalse;
        }

    if ( iCachedSqlStatementReady )
        {
        iCachedSqlStatement.Close();
        iCachedSqlStatementReady = EFalse;
        }
	
	delete iCntSqlStatement;
	delete iTextDef;
	}
Esempio n. 25
0
void CWatcherActiveStep::RunL()
	{
	if (iTestState==EStateFinish)
		{
		Deque();
		CActiveScheduler::Stop();
		return;
		}

	if (iMediaChange)
		{
		iMediaChange=EFalse;
		CheckResults();
		}
	else
		{
		RunTestsL();
		}
	}
Esempio n. 26
0
// -----------------------------------------------------------------------------
// CUpdateManager::~CUpdateManager
//
// Deconstructor.
// ----------------------------------------------------------------------------- 
CUpdateManager::~CUpdateManager()
    {
    Stop();
    for( int i=0; i<iQueueArray.Count(); i++ )
        {
        delete iQueueArray[ i ];
        }
    if( iUpdateAllFeedTask == NULL )
        {
        delete iUpdateAllFeedTask;
        iUpdateAllFeedTask = NULL;    
        }
    delete iLazyCaller;
    delete iHttpConnection;
    delete iRoamingInfo;
    iHttpConnection = NULL;
    iRoamingInfo = NULL;
   	Deque();
    }
Esempio n. 27
0
int main( void ){
	IntQueue que;
	if( Initialize( &que, 10 ) == -1 ){
		puts( "キューの生成に失敗しました。" );
		return -1;
	}

	while( 1 ){
		int m, x;
		printf( "現在のデータ数:%d / %d\n", Size( &que ), Capacity( &que ) );
		printf( "(1)エンキュー (2)デキュー (3)ピーク (4)表示 (0)終了 :" );
		scanf( "%d", &m );
		if( m == 0 ) break;

		switch( m ){
		case 1:	//Enque
			printf("データ:");
			scanf( "%d", &x );
			if( Enque( &que, x ) == -1 )
				puts( "\aエラー:データのエンキューに失敗しました。" );
			break;

		case 2:	//Deque
			if( Deque( &que, &x ) == -1 )
				puts( "\aエラー:デキューに失敗しました。" );
			else
				printf( "デキューしたデータは%dです。\n", x );
			break;

		case 3:	//Peek
			if( Peek( &que, &x ) == -1 )
				puts( "ピークに失敗しました。" );
			else
				printf( "ピークしたデータは%dです。\n, x" );
			break;
		case 4:
			Print( &que );
			break;
		}
	}
	Terminate( &que );
	return 0;
}
Esempio n. 28
0
CDnsSocketWriter::~CDnsSocketWriter()
	{
	// As this class is managed by CDnsSocket, it is impossible
	// to get here if IsActive(), or with requests in any queue.
	// (DeactivateSocket is ALWAYS called before destructor)
	//
	ASSERT(!IsActive());
	ASSERT(iSendQueue.IsEmpty());
	ASSERT(iWaitQueue.IsEmpty());

	delete iReader;

	Cancel();	// should not be needed...
	if (IsAdded())
		Deque();
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY		
	iAttachedConn.Close();
#endif	
	LOG(Log::Printf(_L("CDnsSocketWriter[%u]::~CDnsSocketWriter()"), this));
	}
Esempio n. 29
0
int main()
{
    FILE *IN,*OUT;
    IN=fopen("input.dat","r");
    OUT=fopen("output.dat","w");
    int x[100],i=0,j,sumtime=0,summoney=0,timex,moneyx,g=1;
    char a[100],*money,*time,r[100];
    while(!feof(IN))
        {
        fscanf(IN,"%s",r);
        if(r[0]<'0' || r[0]>'9') break;
        x[i]=atoi(r);
        i++;
        }
    while(fgets(a,100,IN))
    {
        if(g==1)
        {
            money=strtok(a," ");
            time=strtok(NULL," \n");
            g++;
        }
        else
            {
            strtok(a," \n");
            money=strtok(NULL," ");
            time=strtok(NULL," ");
            }
        Enque(atoi(time),atoi(money));
    }
    for(j=0; j<i; j++)
    {
        peek(timex,moneyx);
        sum(moneyx,timex,sumtime,summoney);
        Deque();
        if(sumtime>x[j]) fprintf(OUT,"After %d seconds: %d\n",x[j],summoney-timex);
        else fprintf(OUT,"After %d seconds: %d\n",x[j],summoney);
    }

    return 0;
}
/** Sets observer to be notified of packet process events.

This clears any events that are currently outstanding.

@param aObserver The observer to receive events.  May be set to NULL.
*/
void CObexPacketSignaller::SetFinalPacketObserver(MObexFinalPacketObserver* aObserver)
	{
	LOG1(_L8("CObexPacketSignaller::SetObserver(0x%x)"), aObserver);
	
	// Clear outstanding events for the final packet observer
	// If there's an outstanding final packet event this means 
	// it won't get signalled.
	iOutstandingEvents &= ~(EObexFinalPacketStarted | EObexFinalPacketFinished);
	
	// Add or remove from scheduler if necessary
	if(!iFinalPacketObserver &&!iReadActivityObserver && aObserver)
		{
		CActiveScheduler::Add(this);
		}
	else if(iFinalPacketObserver && !iReadActivityObserver && !aObserver)
		{
		Deque();
		}
	
	iFinalPacketObserver = aObserver;
	}