CSecondaryThread Class Reference
class CSecondaryThread : public CActive |
CSecondaryThread - An active object who's sole purpose is to start the second thread and keep it alive.
Constructor & Destructor Documentation
CSecondaryThread(MLogArrayAccess &, TBool)
Member Functions Documentation
ConstructL()
void | ConstructL | ( | ) | [private] |
Contructs and kicks off the secondary thread, while also issuing a request to be informed if the thread dies, which will run the active object
DoCancel()
Appends a special shutdown message into the log array. When this reaches the head and is run, it shuts down the second thread.
Note: Logs onto second thread and waits for it to finish.
NewL(MLogArrayAccess &, TBool)
RunL()
Runs when second thread dies, and simply restarts it again.
Note: On death a thread-death message is placed in the queue so that a user is aware this happened.
StartSecondaryThread issues a request to be informed of thread death, so starts active object again.
SignalRequestSemaphore()
void | SignalRequestSemaphore | ( | ) | [inline] |
Increment the semaphore count to match the number of msgs in the queue.
We need to signal to the slave thread that we now have work for it. We could have added a semaphore to do this, but there is already one in the second thread that isn't being used: the request semaphore. So, instead we will use that since it is also faster. But the code looks a bit back-to-front since we are calling "RequestComplete" when we are making the request. We also have to pass in a dummy status object since in normal practice this would be part of the request completion process.
StartSecondaryThreadL(TBool)
void | StartSecondaryThreadL | ( | TBool | aRestarting | ) | [private] |
Start the second/consumer/slave thread and issue a request to be told when it dies.
Member Data Documentation
MLogArrayAccess & iArrayAccess
TBool
iFlushingOn
TBool
| iFlushingOn | [private] |
CShutDownMessage * iShutDownMessage
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.