?? threadlistener.cpp
字號:
/*
* ============================================================================
* Name : CThreadListener from ThreadListener.h
* Part of : ThreadAndAO
* Created : 12.1.2005 by Forum Nokia
* Version : 1.0
* Copyright: Nokia Corporation
* ============================================================================
*/
#include "ThreadListener.h"
CThreadListener* CThreadListener::NewL(RThread& aThread)
{
CThreadListener* self = CThreadListener::NewLC(aThread);
CleanupStack::Pop(self);
return self;
}
CThreadListener* CThreadListener::NewLC(RThread& aThread)
{
CThreadListener* self = new (ELeave) CThreadListener();
self->ConstructL(aThread);
CleanupStack::PushL(self);
return self;
}
// ----------------------------------------------------------------------------
// CThreadListener::CThreadListener(void)
//
// Constructor.
// ----------------------------------------------------------------------------
CThreadListener::CThreadListener():
CActive(EPriorityStandard)
{
}
// ----------------------------------------------------------------------------
// CThreadListener::CThreadListener(void)
//
// Destructor.
// ----------------------------------------------------------------------------
CThreadListener::~CThreadListener(void)
{
Cancel();
iMonitoredThread.Close();
}
// Standard Symbian OS 2nd phase constructor
void CThreadListener::ConstructL(RThread& aThread)
{
CActiveScheduler::Add(this);
iMonitoredThread.Open(aThread.Id());
iMonitoredThread.Logon(iStatus);
SetActive();
}
// ----------------------------------------------------------------------------
// CThreadListener::RunL()
//
// iStatus is given to ThreadOne Logon( ).
// Logon requests notification when thread1 dies, normally or otherwise.
// ----------------------------------------------------------------------------
void CThreadListener::RunL()
{
// Only in this example:
// Consider any completion value as an error - exit now
User::Exit(0);
}
// ----------------------------------------------------------------------------
// CThreadListener::DoCancel()
// ----------------------------------------------------------------------------
void CThreadListener::DoCancel()
{
iMonitoredThread.LogonCancel(iStatus);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -