[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LYieldAttachment



Description:

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:

 

LYieldAttachment()  
ExecuteSelf()  

Data Members:

The data members in this class are:

 

mQuantum  
mNextTicks  

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:

(Threads Classes)

UThread.h

UThread.cp

See also:

LAttachment

LThread

LYieldAttachment()

Purpose:

The constructors create the object and initialize the data members to the passed-in values.

Access:

Public

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.

 

ExecuteSelf()

Purpose:

This method yields control to other threads. Note that control is always yielded at least once.

Access:

Virtual, Public

Prototype:

void ExecuteSelf(MessageT inMessage, 
void* ioParam );
Parameters:

This method does not use its parameters.

 

Return:

None

mQuantum

Purpose:

The quantum, or wait time in system ticks between calls to LThread::Yield().

Access:

Protected

Prototype:

SInt32 mQuantum;

mNextTicks

Purpose:

A private value used to decide when to yield.

Access:

Protected

Prototype:

UInt32 mNextTicks;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000