module xdc.runtime.knl.Sync

Provides synchronization APIs when an ISync.Handle is available

The application must first obtain an ISync.Handle. It can get such a handle by directly calling SyncGeneric.create or SyncSemThread.create. Then the application can use the generic APIs provided by this module.
C synopsis target-domain sourced in xdc/runtime/knl/Sync.xdc
 
const Sync_NO_WAIT

Used to specify no waiting

C synopsis target-domain
#define Sync_NO_WAIT (UInt)ISync.NO_WAIT
 
 
const Sync_WAIT_FOREVER

Used to wait forever

C synopsis target-domain
#define Sync_WAIT_FOREVER (UInt)ISync.WAIT_FOREVER
 
 
enum Sync_WaitStatus

Error codes returned by Sync_wait

C synopsis target-domain
typedef enum Sync_WaitStatus {
    Sync_WaitStatus_ERROR,
    Sync_WaitStatus_TIMEOUT,
    Sync_WaitStatus_SUCCESS
} Sync_WaitStatus;
 
 
Sync_query()  // module-wide

Query for a particular quality

C synopsis target-domain
Bool Sync_query(ISync_Handle sync, Int qual);
 
ARGUMENTS
sync — sync handle
qual — quality
DETAILS
FALSE is returned if quality not supported.
RETURNS
TRUE or FALSE.
 
Sync_signal()  // module-wide

Called at completion of an activity

C synopsis target-domain
Void Sync_signal(ISync_Handle sync);
 
ARGUMENTS
sync — sync handle
DETAILS
This function is non-blocking. It is also required that the underlying sync be binary in nature.
 
Sync_wait()  // module-wide

Called to wait/poll for completion of an activity

C synopsis target-domain
Int Sync_wait(ISync_Handle sync, UInt timeout, Error_Block *eb);
 
ARGUMENTS
sync — sync handle
timeout — timeout in microseconds
DETAILS
This function can block and typically waits for a semaphore to become available.
Non-blocking implementations should return WaitStatus_TIMEOUT.
RETURNS
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId Sync_Module_id();
// Get this module's unique id
 
Bool Sync_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle Sync_Module_heap();
// The heap from which this module allocates memory
 
Bool Sync_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 Sync_Module_getMask();
// Returns the diagnostics mask for this module
 
Void Sync_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
 
XDCscript usage meta-domain sourced in xdc/runtime/knl/Sync.xdc
var Sync = xdc.useModule('xdc.runtime.knl.Sync');
local proxy modules
        Sync.Proxy.delegate$ = ISync.Module null
        Sync.Proxy.abstractInstances$ = false
module-wide constants & types
 
        const Sync.WaitStatus_ERROR;
        const Sync.WaitStatus_TIMEOUT;
        const Sync.WaitStatus_SUCCESS;
module-wide config parameters
 
 
proxy Sync.Proxy

Platform-specific implementation

XDCscript usage meta-domain
Sync.Proxy = ISync.Module null
// some delegate module inheriting the ISync interface
    Sync.Proxy.delegate$ = ISync.Module null
    // explicit access to the currently bound delegate module
    Sync.Proxy.abstractInstances$ = false
    // use indirect runtime function calls if true
 
DETAILS
If ALL ISync.Handles were created using the same module (e.g SyncSemProcess), then setting Proxy to SyncSemProcess and Sync.Proxy.abstractInstances$ to false will improve the performance of the Sync APIs.
 
const Sync.NO_WAIT

Used to specify no waiting

XDCscript usage meta-domain
const Sync.NO_WAIT = ISync.NO_WAIT;
 
C SYNOPSIS
 
const Sync.WAIT_FOREVER

Used to wait forever

XDCscript usage meta-domain
const Sync.WAIT_FOREVER = ISync.WAIT_FOREVER;
 
C SYNOPSIS
 
enum Sync.WaitStatus

Error codes returned by Sync_wait

XDCscript usage meta-domain
values of type Sync.WaitStatus
    const Sync.WaitStatus_ERROR;
    const Sync.WaitStatus_TIMEOUT;
    const Sync.WaitStatus_SUCCESS;
 
C SYNOPSIS
 
metaonly config Sync.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
Sync.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
generated on Thu, 01 Mar 2012 16:58:45 GMT