CC32WorkerThread Class Reference
class CC32WorkerThread : public CBase |
Constructor & Destructor Documentation
CC32WorkerThread()
CC32WorkerThread | ( | ) | [protected] |
Member Functions Documentation
CFBindMessageReceived(const CommsFW::TCFBindMsg &)
Deals with binding requests from the Root Server. Note that although the Root Server allows multiple identical bindings C32 does not allow this and will panic if the binding already exists. Bindings are expressed in C32 by CCommsTransport. Since all sub-module names are unique across all C32 instances (they are the individual owning worker ID converted to text) they can be used here. I.e. the remote end sub-module is converted back to int and used to insert the CCommsTransport into an array in the position corresponding to the remote end sub-module name/number. As for responding to the bind request there are two cases:
This worker is a "dumb" Player: Send bind response immediately.
This worker is the Main thread: Send introduction messages to remote end and postpone bind response until introduction response messages have arrived back. CCommsTransport
CFShutdownMessageReceived(const CommsFW::TCFShutdownMsg &)
A shutdown message can be of several types:
EImmediate: We shutdown immediately even if leaking resources, although doing a best effort to cleanup. However, SymbianOS doesnt allow the server to gracefully terminate sessions so certain things cant be cleaned up.
EOptional: Ignored.
EGraceful: The module only unloads once no resources remain, which means for the Dealer no sessions and for the Player no subsessions. The shutdown request arrives after the unbind requests. CommsFW::TCFShutdownMsg CommsFW::TCFShutdownType CC32Dealer::ProcessShutdownRequest CC32Player::ProcessShutdownRequest CC32WorkerThread::SetShuttingDown CC32WorkerThread::MaybeTriggerThreadShutdownCallback
CFUnbindMessageReceived(const CommsFW::TCFUnbindMsg &)
The unbind requests are only responded to once the channel is presumed to be idle:
for Dealers this means no sessions remain with subsessions on that Player
for Players this means no subsessions remain for that Dealer So the peer handler is marked as pending unbind but the unbind response is not sent back until both Dealer and Player (if any) confirm idleness, which has to be checked whenever closing sessions or subsessions. Perhaps this could/should switch to using ref counts? Once unbind is pending the Dealer refrains from creating any new subsessions which use it. CC32WorkerThread::MaybeCompleteUnbinding
ConstructL(CommsFW::TCFModuleInfo *)
The worker thread secondary construction will create the relevant Player/Dealer instances needed as well as the channel handler to the Root Server. If and only if it is the main thread it will also create the PitBoss.
Note: If it has a Dealer and is not the main thread it is a WorkerDealer.
Dealer()
CC32Dealer * | Dealer | ( | ) | const [inline] |
DealerByRef()
CC32Dealer & | DealerByRef | ( | ) | const [inline] |
DealerShutdownComplete()
TBool
| DealerShutdownComplete | ( | ) | const [inline] |
DecProlongBindingLife()
void | DecProlongBindingLife | ( | ) | [private, inline] |
DecodePeerId(const CommsFW::TCFSubModuleAddress *, const CommsFW::TCFSubModuleAddress *, CommsFW::TWorkerId &)
DeleteHBufC8(TAny *)
void | DeleteHBufC8 | ( | TAny * | aHBufC | ) | [private, static] |
DetermineRoleL(const TDesC8 &, TBool &, TBool &)
void | DetermineRoleL | ( | const TDesC8 & | aIniData, |
| TBool & | aIsDealer, |
| TBool & | aIsPlayer |
| ) | [private] |
Determine from inidata whether this worker is Dealer, Player or both.
DispatchL(const CommsFW::TCFMessage &, CommsFW::TWorkerId)
IncProlongBindingLife()
void | IncProlongBindingLife | ( | ) | [private, inline] |
IsMainThread()
TBool
| IsMainThread | ( | ) | const [inline] |
Use this to discover whether this Worker Thread is EMainThread ("C32_Main") which is the main Dealer. TWorkerThreadInfo
MaybeCompleteUnbinding(CommsFW::TWorkerId)
MaybeCompleteUnbindings()
void | MaybeCompleteUnbindings | ( | ) | [private] |
MaybeTriggerThreadShutdownCallback()
void | MaybeTriggerThreadShutdownCallback | ( | ) | |
NewL(CommsFW::TCFModuleInfo *)
OnDispatchLeave(const CommsFW::TCFMessage &, CommsFW::TWorkerId, TInt)
PeerReachable(CommsFW::TWorkerId)
Player()
CC32Player * | Player | ( | ) | const [inline] |
PlayerShutdownComplete()
TBool
| PlayerShutdownComplete | ( | ) | const [inline] |
PostMessage(CommsFW::TWorkerId, CommsFW::TCFMessage &)
ProcessIniDataL()
void | ProcessIniDataL | ( | ) | [private] |
RunC32Thread(CommsFW::TCFModuleInfo *)
SessionShutdownComplete()
void | SessionShutdownComplete | ( | ) | |
SetDealerShutdownComplete(TBool)
void | SetDealerShutdownComplete | ( | TBool | aComplete | ) | |
SetPlayerShutdownComplete(TBool)
void | SetPlayerShutdownComplete | ( | TBool | aComplete | ) | |
ShuttingDown()
TBool
| ShuttingDown | ( | ) | const |
ThreadEntryPoint(TAny *)
IMPORT_C TInt | ThreadEntryPoint | ( | TAny * | aArg | ) | [static] |
This is the main thread function used by the RootServer when creating a new C32 thread. The RootServer will know the DLL ordinal for it, as specified in the .CMI file, and this is where an C32 instance starts and ends operation (unless it PANICs). CommsFW::TCFModuleInfoThe C32 thread. This is where control will resume when the RootServer starts a C32 instance. This function creates the worker thread object and starts the active scheduler.
Parameters
TAny * aArg | Will be the module info structure from the RootServer. |
TriggerThreadShutdownCallback()
void | TriggerThreadShutdownCallback | ( | ) | |
Member Data Documentation
CCommChannelHandler * iChannelHandler
This is the handler used for bi-directional communication with the Root Server.
CC32Dealer * iDealer
CC32Dealer * | iDealer | [private] |
TBool
iDealerShutdownComplete
TBool
| iDealerShutdownComplete | [private] |
Set by the Dealer instance to signal to the Worker Thread that it has finished with the shutdown bookkeeping and is ready to be deleted. This essentially means no sessions remain.
CC32Player * iPlayer
CC32Player * | iPlayer | [private] |
TBool
iPlayerShutdownComplete
TBool
| iPlayerShutdownComplete | [private] |
Set by the Player instance to signal to the Worker Thread that it has finished with the shutdown bookkeeping and is ready to be deleted.
TInt
iProlongBindingLife
TInt
| iProlongBindingLife | [private] |
If the value of this TInt is larger than 0 any unbind requests will not be served, but postponed until iProlongBindingLife is 0. This is to ensure that if e.g. a TWorkerMsg::ECleanupDeadPeer or TPlayerMsg::ESessionClose is received they will be fully served before completing any unbind and thus deleting channel handlers.
CommsFW::CCommsTransport * iTransport
CommsFW::TWorkerId
iWorkerId
Indentification of this thread. No other instance must have the same id. TWorkerThreadInfo
CC32WorkerRegister * iWorkerRegister
TBool
iWorkerShuttingDown
TBool
| iWorkerShuttingDown | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.