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.
XDCspec summary sourced in xdc/runtime/knl/Sync.xdc
module Sync {  ...
// inherits xdc.runtime.IModule
C synopsis target-domain
XDCscript usage meta-domain
var Sync = xdc.useModule('xdc.runtime.knl.Sync');
local proxy modules
        Sync.Proxy.delegate$ = ISync.Module null
        Sync.Proxy.abstractInstances$ = false
module-wide config parameters
 
XDCspec declarations sourced in xdc/runtime/knl/Sync.xdc
package xdc.runtime.knl;
 
module Sync {
local proxy modules
    proxy Proxy inherits ISync;
module-wide config parameters
module-wide functions
    Bool query// Query for a particular quality( ISync.Handle sync, Int qual );
}
 
proxy Sync.Proxy

Proxy used for optimization

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 this Proxy to SyncSemProcess and setting Sync.Proxy.abstractInstances$ = false, Sync APIs can have better performance.
 
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.
 
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
RETURNS
TRUE or FALSE.
DETAILS
FALSE is returned if quality not supported.
 
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
RETURNS
1 for success; 0 for timeout; -1 for error
DETAILS
This function can block. Non-blocking implementations should return false;
 
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
 
generated on Thu, 25 Jun 2009 21:46:10 GMT