Interface for OS specific back-end. [EXPERIMENTAL]
The
xdc.runtime.knl package contains modules that provide typical
OS services. These xdc.runtime.knl modules require proxies to be
bound to an OS specific delegate. This specifies the interface to
be implemented by the OS specific delegate for
xdc.runtime.knl.SemThread module.
This interface adds the create() function.
const ISemThreadSupport.FOREVER |
|
Used as the timeout value to specify wait forever
const UInt FOREVER = ~(0);
enum ISemThreadSupport.Mode |
|
Types of semaphores
enum Mode {
Mode_COUNTING,
// Counting semaphore
Mode_BINARY
// Binary Semaphore
};
enum ISemThreadSupport.PendStatus |
|
Error codes returned by Semaphore_pend
enum PendStatus {
PendStatus_ERROR,
PendStatus_TIMEOUT,
PendStatus_SUCCESS
};
metaonly config ISemThreadSupport.common$ // module-wide |
|
Common module configuration parameters
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.
per-instance object types |
|
typedef struct ISemThreadSupport_Object *ISemThreadSupport_Handle;
// Client reference to an abstract instance object
per-instance config parameters |
|
XDCscript usage |
meta-domain |
var params = new ISemThreadSupport.Params;
// Instance config-params object
// Semaphore mode. Default is COUNTING
typedef struct ISemThreadSupport_Params {
// Instance config-params structure
// Common per-instance configs
// Semaphore mode. Default is COUNTING
} ISemThreadSupport_Params;
config ISemThreadSupport.mode // per-instance |
|
Semaphore mode. Default is COUNTING
DETAILS
When mode is BINARY , the semaphore has only two states, available
and unavailable. When mode is COUNTING, the semaphore keeps track of
number of times a semaphore is posted.
per-instance creation |
|
create( Int count );
// Create an instance-object
ARGUMENTS
count
initial semaphore count
DETAILS
This function creates a new Semaphore object which is initialized to
count.
ISemThreadSupport.pend( ) // per-instance |
|
Wait for the semaphore to become available
ARGUMENTS
timeout
timeout in microseconds
eb
error block
DETAILS
RETURNS
refer to description above
ISemThreadSupport.post( ) // per-instance |
|
Increment the semaphore count
ARGUMENTS
eb
error block
RETURNS
true for success, false for error in error block
per-instance convertors |
|
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure