OSWaitRendezvous

Syntax

#include <cafe/os.h>

BOOL OSWaitRendezvous(OSRendezvous* ren, u32 wmask);

Parameters

ren OSRendezvous on which to wait. OSRendezvous must be initialized prior to calling this function.
wmask Mask applied that determines which processor cores to wait upon.

Return Values

Returns TRUE if the OSRendezvous was successful.

Description

Causes the thread or task to busy-wait until the specified set of processor cores all reach the OSRendezvous. The wmask flags for OSWaitRendezvous are not what cores that should wait, but what cores the current core should wait for. When a core enters OSWaitRendezvous, it sets its own core flag, and then waits for the flags specified by wmask to be set.

To guard against reinitialization of a rendezvous, a second rendezvous may be used:

OSInitRendezvous(rendezvousReinit);
OSWaitRendezvous(rendezvous, OS_WAIT_CORE_MAIN | OS_WAIT_CORE_SUB2);
OSWaitRendezvous(rendezvousReinit, OS_WAIT_CORE_MAIN | OS_WAIT_CORE_SUB2);
OSInitRendezvous(rendezvous);

Using the double rendezvous insures that all cores pass the first rendezvous before initializing the first rendezvous.

NOTE:
The second rendezvous must be initialized before the first rendezvous is entered.

Failure to insure that all cores have passed the rendezvous before reinitializing the rendezvous data structure may cause a thread on a core other than the core reinitializing the rendezvous to miss the fact that all cores have reached rendezvous.

Do Not Call From

Multiple threads This function is not thread-safe.
Callbacks Do not call this function from any callback function.

See Also

OSInitRendezvous
OSWaitRendezvousWithTimeout

Revision History

2013/05/08 Automated cleanup pass.
2012/08/01 Cleanup Pass.
2012/05/25 Matched actual prototype.
2010/08/23 Initial version.


CONFIDENTIAL