LYieldAttachment is a PowerPlant class that is used for yielding
control to another thread before returning. It obviates the need
to override LApplication::ProcessNextEvent() in order to give time to other threads.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
The concept of an Attachment is a powerful underlying concept of PowerPlant's inner workings. For a detailed discussion on this topic, refer to The PowerPlant Book.
Source files:
See also:
Purpose:
The constructors create the object and initialize the data members to the passed-in values.
Access:
Prototype:
LYieldAttachment( SInt32 inQuantum);Parameters:
The optional parameter to the constructor lets you specify how
much time should elapse before control returns to the caller.
This is useful for preventing WaitNextEvent() from being called too often.
Purpose:
This method yields control to other threads. Note that control is always yielded at least once.
Access:
Prototype:
void ExecuteSelf(MessageT inMessage,Parameters:
void* ioParam );
This method does not use its parameters.
Return:
Purpose:
The quantum, or wait time in system ticks between calls to LThread::Yield().
Access:
Prototype:
SInt32 mQuantum;
Purpose:
A private value used to decide when to yield.
Access:
Prototype:
UInt32 mNextTicks;