void CImageRotator::RunL() { if(iStatus == KErrNone){ if(RotationNum == 1) { RotationNum = 2; iPicture->iBitmap = iBitmap; if(iMask != NULL) { iBmpRotator->Rotate(&iStatus, *iMask, iAngle); #ifdef USE_TRACE TRACE_FUNC(); #endif SetActive(); } else { iPicture->RotationComplete(); DoCancel(); } } else if(RotationNum == 2) { RotationNum = 3; iPicture->iMask = iMask; iPicture->RotationComplete(); DoCancel(); } } }
/** Destroy a nanokernel timer @pre Call in thread context, interrupts enabled, preemption enabled @pre Calling thread in critical section @pre No fast mutex held @publishedPartner @prototype */ EXPORT_C NTimer::~NTimer() { if (!IsMutating() && iTied) { NKern::Lock(); // remove from tied thread/group NEventHandler::TiedLock.LockOnly(); NSchedulable* tied = iTied; DoCancel(ECancelDestroy); if (tied) // might have been dequeued by thread/group termination { tied->AcqSLock(); if (iTiedLink.iNext) { iTiedLink.Deque(); iTiedLink.iNext = 0; } iTied = 0; tied->RelSLock(); } NEventHandler::TiedLock.UnlockOnly(); NKern::Unlock(); } else if (IsMutating() && iDfcQ) DoCancelMutating(ECancelDestroy); else DoCancel(ECancelDestroy); }
EyeConfig::EyeConfig (eyes *parent) :pEyes(parent) { setupUi(this); connect (cancelBut,SIGNAL(clicked()),this,SLOT(DoCancel())); connect (okBut,SIGNAL(clicked()),this,SLOT(DoOk())); connect (applyBut, SIGNAL(clicked()),this,SLOT(DoApply())); connect (quitBut, SIGNAL(clicked()),this,SLOT(quit())); connect (versionButton, SIGNAL(clicked()), this,SLOT(DoShowVersion())); connect (authorButton, SIGNAL(clicked()), this,SLOT(DoLinkAuthor())); connect (eyesCheck, SIGNAL(stateChanged(int)), this,SLOT(DoCheckEyes(int))); connect (arrowCheck, SIGNAL(stateChanged(int)), this,SLOT(DoCheckArrow(int))); connect (bubbleCheck, SIGNAL(stateChanged(int)), this,SLOT(DoCheckBubble(int))); connect (frameCheck, SIGNAL(stateChanged(int)), this,SLOT(DoCheckFrame(int))); }
void DChannelComm::HandleMsg(TMessageBase* aMsg) { TThreadMessage& m = *(TThreadMessage*)aMsg; TInt id = m.iValue; if (id == (TInt)ECloseMsg) { Shutdown(); iStatus = EClosed; m.Complete(KErrNone, EFalse); return; } else if (id == KMaxTInt) { // DoCancel DoCancel(m.Int0()); m.Complete(KErrNone, ETrue); return; } if (id < 0) { // DoRequest TRequestStatus* pS = (TRequestStatus*)m.Ptr0(); TInt r = DoRequest(~id, pS, m.Ptr1(), m.Ptr2()); if (r != KErrNone) Kern::RequestComplete(iClient, pS, r); m.Complete(KErrNone, ETrue); } else { // DoControl TInt r = DoControl(id, m.Ptr0(), m.Ptr1()); m.Complete(r, ETrue); } }
void CMdSGarbageCollector::Pause() { #ifdef _DEBUG RDebug::Print( _L("CMdSGarbageCollector::Pause") ); #endif DoCancel(); }
DiscoveryClient::~DiscoveryClient() { if (_registered.load(butil::memory_order_acquire)) { bthread_stop(_th); bthread_join(_th, NULL); DoCancel(); } }
/** Destructor */ DDriver1Channel::~DDriver1Channel() { // Cancel all processing that we may be doing DoCancel(RDriver1::EAllRequests); // Close our reference on the client thread Kern::SafeClose((DObject*&)iClient,NULL); }
void TagsEditor::OnKeyDown(wxKeyEvent &event) { if (event.GetKeyCode() == WXK_ESCAPE) DoCancel(true); else event.Skip(); }
// --------------------------------------------------------------------------- // CPresenceXDM::CancelUpdateL() // --------------------------------------------------------------------------- // EXPORT_C void CPresenceXDM::CancelUpdateL() { OPENG_DP(D_OPENG_LIT( "CPresenceXDM::CancelUpdateL" )); if (IsActive()) { DoCancel(); } }
// ----------------------------------------------------------------------------- // CDpPn2Rx::ReleaseNotify // This method signals ourselves. // ----------------------------------------------------------------------------- // void CDpPn2Rx::ReleaseNotify() { OstTrace0( TRACE_NORMAL, CDPPN2RX_RELEASENOTIFY, "CDpPn2Rx::ReleaseNotify" ); LOGM("CDpPn2Rx::ReleaseNotify"); // This is done because receive data might me also active DoCancel(); }
void CCanceledLoadCpm::WaitForTimer(TInt aTimeout_ms) { iState = EWaitingforTimer; DoCancel(); // in case timer already running iTimer.After(iStatus, aTimeout_ms * 1000); SetActive(); }
void CCanceledLoadCpm::TryCancelDeath() { // we are already active cos we are waiting on our subscription // therefore we will simply cancel the property subscription iState=EIdle; DoCancel(); }
/** Process a message for this logical channel. This function is called in the context of a DFC thread. @param aMessage The message to process. The iValue member of this distinguishes the message type: iValue==ECloseMsg, channel close message iValue==KMaxTInt, a 'DoCancel' message iValue>=0, a 'DoControl' message with function number equal to iValue iValue<0, a 'DoRequest' message with function number equal to ~iValue */ void DZeroCopyLoopbackChannel::HandleMsg(TMessageBase* aMsg) { TThreadMessage& m=*(TThreadMessage*)aMsg; // Get message type TInt id=m.iValue; // Decode the message type and dispatch it to the relevent handler function... if (id==(TInt)ECloseMsg) { // Channel Close PRINT_PROBE_POINTS("ldd"); DoCancel(RZeroCopyLoopbackDriver::EAllRequests); m.Complete(KErrNone, EFalse); return; } if (id==KMaxTInt) { // DoCancel DoCancel(m.Int0()); m.Complete(KErrNone,ETrue); return; } if (id<0) { // DoRequest TRequestStatus* pS=(TRequestStatus*)m.Ptr0(); TInt r=DoRequest(~id,pS,m.Ptr1(),m.Ptr2()); if (r!=KErrNone) { Kern::RequestComplete(iClient,pS,r); } m.Complete(KErrNone,ETrue); } else { // DoControl TInt r=DoControl(id,m.Ptr0(),m.Ptr1()); m.Complete(r,ETrue); } }
DZeroCopyLoopbackChannel::~DZeroCopyLoopbackChannel() { // Cancel all processing that we may be doing DoCancel(RZeroCopyLoopbackDriver::EAllRequests); delete iPond; // Close our reference on the client thread Kern::SafeClose((DObject*&)iClient,NULL); }
PrefEdit::PrefEdit () { setupUi (this); storyTextSize->setMinimum(DRSSConfig::minTextFactor); storyTextSize->setMaximum(DRSSConfig::maxTextFactor); hide(); connect (okButton,SIGNAL(clicked()),this,SLOT(DoOk())); connect (cancelButton,SIGNAL(clicked()),this,SLOT(DoCancel())); connect (defaultsButton,SIGNAL(clicked()),this,SLOT(ResetToDefaults())); running = false; }
static int rh_e_h(GWindow gw, GEvent *event) { if ( event->type==et_close ) { DoCancel( GDrawGetUserData(gw)); } else if ( event->type == et_char ) { return( false ); } else if ( event->type == et_map ) { /* Above palettes */ GDrawRaise(gw); } return( true ); }
// --------------------------------------------------------------------------- // Cancel thumbnail request // --------------------------------------------------------------------------- // void CThumbnailVideoProvider::CancelGetThumbnail() { // run DoCancel even if not active if ( IsActive() ) { Cancel(); } else { DoCancel(); } }
// ----------------------------------------------------------------------------- // CThumbnailImageDecoder::RunL() // ----------------------------------------------------------------------------- // void CThumbnailVideoProvider::RunL() { DoCancel(); // video thumbnail engine doesn't respond if (iTimeout) { iObserver->ThumbnailProviderReady( KErrCompletion, NULL, TSize(), EFalse, EFalse); iTimeout = EFalse; TN_DEBUG1( "CThumbnailVideoProvider::RunL() - timeout" ); OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_RUNL, "CThumbnailVideoProvider::RunL - timeout" ); } }
void DISIKernelChannel::HandleThreadMsg( TThreadMessage& aMsg ) { C_TRACE( ( _T( "DISIKernelChannel::HandleThreadMsg 0x%x 0x%x 0x%x>" ), this, &aMsg, iObjId ) ); TThreadMessage& m = ( aMsg ); TInt completeValue( KErrNone ); TBool complete( ETrue ); switch( m.iValue ) { // All asynchronous requests. Return result after DFC function is run. case EISIAsyncReceive: { // No need to check return value in async functions, completed to client from DFC. HandleDfcRequest( m ); break; } // From synchronized request return the result immediately case EISIConnect: case EISIDisconnect: case EISIAllocateBlock: case EISIDeallocateBlock: case EISISend: { completeValue = HandleSyncRequest( m ); break; } case KDestroyChannelMsg: { completeValue = KErrNone; // Don't receive anymore messages. complete = EFalse; break; } case KMaxTInt: { completeValue = KErrNone; DoCancel( KMaxTInt, m.Int0() ); break; } default: { ASSERT_RESET_ALWAYS( 0, ( EISIKernelChannelWrongRequest | EDISIKernelChannelId << KClassIdentifierShift ) ); break; } } m.Complete( completeValue, complete ); C_TRACE( ( _T( "DISIKernelChannel::HandleThreadMsg 0x%x< 0x%x" ), this, iObjId ) ); }
void CWebServerEng::Reset() { // This function is need due to Error recovery. // If we are in the EErrorRecovery state, the webserver engine is not active, but it can still have connections. // Therefore, they must be destroyed. A simple Cancel() doesn't work because the DoCancel() function is not called // when the Active Object is not active. if (iWebServerState == EErrorRecovery) { DoCancel(); } else { Cancel(); } }
void DISIKernelChannel::Disconnect( // None ) { C_TRACE( ( _T( "DISIKernelChannel::Disconnect 0x%x 0x%x>" ), this, iObjId ) ); ResetQueues(); for( TInt i( EISILastSyncRequest ); i < EISILastAsyncRequest; ++i ) { C_TRACE( ( _T( "DISIKernelChannel::CancelRequests req to cancel %d" ), i ) ); DoCancel( KMaxTInt, i ); } iRouterIf->Disconnect( iObjId ); iRouterIf->FreeDfcThread( iMainThread ); iRouterIf->FreeDfcThread( iCompletionThread ); C_TRACE( ( _T( "DISIKernelChannel::Disconnect 0x%x 0x%x<" ), this, iObjId ) ); }
//--------------------------------------------------------------------------- void __fastcall TAuthenticateForm::Dispatch(void * AMessage) { TMessage & Message = *reinterpret_cast<TMessage *>(AMessage); if (Message.Msg == WM_NCCREATE) { WMNCCreate(*reinterpret_cast<TWMNCCreate *>(AMessage)); } else if (Message.Msg == WM_CLOSE) { DoCancel(); TForm::Dispatch(AMessage); } else { TForm::Dispatch(AMessage); } }
// --------------------------------------------------------------------------- // CThumbnailVideoProvider::~CThumbnailVideoProvider() // Destructor. // --------------------------------------------------------------------------- // CThumbnailVideoProvider::~CThumbnailVideoProvider() { // run DoCancel even if not active if ( IsActive() ) { Cancel(); } else { DoCancel(); } iTimer.Close(); TN_DEBUG1( "CThumbnailVideoProvider::~CThumbnailVideoProvider()" ); OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_CTHUMBNAILVIDEOPROVIDER, "CThumbnailVideoProvider::~CThumbnailVideoProvider" ); REComSession::DestroyedImplementation( iDtor_ID_Key ); }
void CMyTimer::RunL() // // The timer has completed. // { iCount++; test.Printf(_L("Timer %03d\n"),iCount); if (iCount==EStopCount) MoreIdle->Cancel(); if (iCount<EMaxCount) After(ETimeReq); else { test.Printf(_L("\n")); DoCancel(); CActiveScheduler::Stop(); } }
// // DTrkXtiChannel::HandleMsg // void DTrkXtiChannel::HandleMsg(TMessageBase* aMsg) { LOG_MSG("DTrkXtiChannel::HandleMsg()"); TThreadMessage& m = *(TThreadMessage*)aMsg; TInt id = m.iValue; if (id == (TInt)ECloseMsg) { if (iTrkXtiSubscriber) { Kern::SemaphoreWait(*iLock); delete iTrkXtiSubscriber; iTrkXtiSubscriber = NULL; Kern::SemaphoreSignal(*iLock); } m.Complete(KErrNone, EFalse); return; } if (id == KMaxTInt) { // DoCancel DoCancel(m.Int0()); m.Complete(KErrNone, ETrue); return; } if (id < 0) { // DoRequest TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0(); DoRequest(~id, pStatus, m.Ptr1(), m.Ptr2()); m.Complete(KErrNone, ETrue); } else { // DoControl TInt err = DoControl(id, m.Ptr0(), m.Ptr1()); m.Complete(err, ETrue); } }
void DExampleChannel::HandleMsg(TMessageBase* aMsg) { TThreadMessage& m=*(TThreadMessage*)aMsg; TInt id=m.iValue; if (id==(TInt)ECloseMsg) { Shutdown(); m.Complete(KErrNone,EFalse); return; } // we only support one client if (m.Client() != iClient) { m.Complete(KErrAccessDenied,ETrue); return; } if (id==KMaxTInt) { // DoCancel DoCancel(m.Int0()); m.Complete(KErrNone,ETrue); return; } else if (id<0) { // DoRequest TRequestStatus* pS=(TRequestStatus*)m.Ptr0(); TInt r=DoRequest(~id,pS,m.Ptr1(),m.Ptr2()); if (r!=KErrNone) Kern::RequestComplete(m.Client(),pS,r); m.Complete(KErrNone,ETrue); } else { // DoControl TInt r=DoControl(id,m.Ptr0(),m.Ptr1()); m.Complete(r,ETrue); } }
/** All driver's client requests (synchronous and asynchronous) are sent as kernel messages by generic kernel to logical channel. This function catches messages sent by the generic kernel. @param aMsg Kernel side thread message to process. The iValue member of this distinguishes the message type: iValue==ECloseMsg, channel close message iValue==KMaxTInt, a 'DoCancel' message iValue>=0, a 'DoControl' message with function number equal to iValue iValue<0, a 'DoRequest' message with function number equal to ~iValue */ void DDisplayLdd::HandleMsg(TMessageBase* aMsg) { TThreadMessage& m = *(TThreadMessage*)aMsg ; TInt id = m.iValue ; DThread* client = m.Client(); // close message if (id == (TInt)ECloseMsg) { //Device specific cleanup operations Pdd()->CloseMsg(); // cancel outstanding requests for(TInt k = 0; k < KPendingReqArraySize; k++) { for(TInt i = 0; i < KMaxQueuedRequests; i++) { if( iPendingReq[k][i].iTClientReq) { if(iPendingReq[k][i].iTClientReq->IsReady() ) { CompleteRequest(iPendingReq[k][i].iOwningThread,iPendingReq[k][i].iTClientReq,KErrCancel); } } } } Pdd()->SetLegacyMode(); m.Complete(KErrNone, EFalse); return; } // cancel if (id == KMaxTInt) { // DoCancel TInt req = m.Int0() >> 1; DoCancel(req); m.Complete(KErrNone,ETrue); return; }
EXPORT_C void CMdEQuery::Cancel() { // is query incomplete before canceling TBool incomplete = !IsComplete(); if( incomplete ) { DoCancel(); } if( iConditions ) { iConditions->SetLocked( EFalse ); } if( incomplete || IsComplete() == EFalse ) { iState = EStateError; if( !iDestroyed ) { NotifyCompleted( KErrCancel ); } } }
void TagsEditor::OnCancel(wxCommandEvent & WXUNUSED(event)) { DoCancel(false); }
void Animation::Cancel() { DoCancel(); PostUpdate(); }