const SemThreadSupport_FOREVER |
 |
Used as the timeout value to specify wait forever
#define SemThreadSupport_FOREVER (UInt)~(0)
enum SemThreadSupport_Mode |
 |
Types of semaphores
typedef enum SemThreadSupport_Mode {
SemThreadSupport_Mode_COUNTING,
// Counting semaphore
SemThreadSupport_Mode_BINARY
// Binary Semaphore
} SemThreadSupport_Mode;
enum SemThreadSupport_PendStatus |
 |
Error codes returned by Semaphore_pend
typedef enum SemThreadSupport_PendStatus {
SemThreadSupport_PendStatus_ERROR,
SemThreadSupport_PendStatus_TIMEOUT,
SemThreadSupport_PendStatus_SUCCESS
} SemThreadSupport_PendStatus;
config SemThreadSupport_A_POSIX_Error // module-wide |
 |
extern const Assert_Id SemThreadSupport_A_POSIX_Error;
config SemThreadSupport_E_POSIX_Error // module-wide |
 |
extern const Error_Id SemThreadSupport_E_POSIX_Error;
config SemThreadSupport_E_resetError // module-wide |
 |
extern const Error_Id SemThreadSupport_E_resetError;
Module-Wide Built-Ins |
 |
// Get this module's unique id
Bool SemThreadSupport_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool SemThreadSupport_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 SemThreadSupport_Module_getMask();
// Returns the diagnostics mask for this module
Void SemThreadSupport_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
 |
typedef struct SemThreadSupport_Object SemThreadSupport_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct SemThreadSupport_Struct SemThreadSupport_Struct;
// Opaque client structure large enough to hold an instance object
// Convert this instance structure pointer into an instance handle
// Convert this instance handle into an instance structure pointer
Instance Config Parameters |
 |
typedef struct SemThreadSupport_Params {
// Instance config-params structure
// Common per-instance configs
// Semaphore mode. Default is COUNTING
} SemThreadSupport_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config SemThreadSupport_mode // 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.
Instance Creation |
 |
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
count
initial semaphore count
params
per-instance config params, or NULL to select default values (target-domain only)
eb
active error-handling block, or NULL to select default policy (target-domain only)
DETAILS
This function creates a new Semaphore object which is initialized to
count.
Instance Deletion |
 |
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
SemThreadSupport_pend() // instance |
 |
Wait for the semaphore to become available
ARGUMENTS
handle
handle of a previously-created SemThreadSupport instance object
timeout
timeout in microseconds
eb
error block
DETAILS
RETURNS
refer to description above
SemThreadSupport_post() // instance |
 |
Increment the semaphore count
ARGUMENTS
handle
handle of a previously-created SemThreadSupport instance object
eb
error block
RETURNS
true for success, false for error in error block
Instance Convertors |
 |
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure
// unconditionally move 2 levels up the inheritance hierarchy
// conditionally move 2 levels down the inheritance hierarchy; NULL upon failure
Instance Built-Ins |
 |
Int SemThreadSupport_Object_count();
// The number of statically-created instance objects
// The handle of the i-th statically-created instance object (array == NULL)
// The handle of the first dynamically-created instance object, or NULL
// The handle of the next dynamically-created instance object, or NULL
// The heap used to allocate dynamically-created instance objects
// The label associated with this instance object
// The name of this instance object
const SemThreadSupport.FOREVER |
 |
Used as the timeout value to specify wait forever
XDCscript usage |
meta-domain |
const SemThreadSupport.FOREVER = ~(0);
C SYNOPSIS
enum SemThreadSupport.Mode |
 |
Types of semaphores
XDCscript usage |
meta-domain |
values of type SemThreadSupport.Mode
const SemThreadSupport.Mode_COUNTING;
// Counting semaphore
const SemThreadSupport.Mode_BINARY;
// Binary Semaphore
C SYNOPSIS
enum SemThreadSupport.PendStatus |
 |
Error codes returned by Semaphore_pend
XDCscript usage |
meta-domain |
values of type SemThreadSupport.PendStatus
const SemThreadSupport.PendStatus_ERROR;
const SemThreadSupport.PendStatus_TIMEOUT;
const SemThreadSupport.PendStatus_SUCCESS;
C SYNOPSIS
config SemThreadSupport.A_POSIX_Error // module-wide |
 |
XDCscript usage |
meta-domain |
msg: "A_POSIX_Error: a POSIX function returned failure"
};
C SYNOPSIS
config SemThreadSupport.E_POSIX_Error // module-wide |
 |
XDCscript usage |
meta-domain |
msg: "E_POSIX_Error: a POSIX function returned failure, errno is %d"
};
C SYNOPSIS
config SemThreadSupport.E_resetError // module-wide |
 |
XDCscript usage |
meta-domain |
msg: "E_resetError: %s returned failure"
};
C SYNOPSIS
metaonly config SemThreadSupport.common$ // module-wide |
 |
Common module configuration parameters
XDCscript usage |
meta-domain |
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.
Instance Config Parameters |
 |
XDCscript usage |
meta-domain |
var params = new SemThreadSupport.Params;
// Instance config-params object
// Semaphore mode. Default is COUNTING
config SemThreadSupport.mode // instance |
 |
Semaphore mode. Default is COUNTING
XDCscript usage |
meta-domain |
var params = new SemThreadSupport.Params;
...
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.
C SYNOPSIS
Instance Creation |
 |
XDCscript usage |
meta-domain |
var params =
new SemThreadSupport.
Params;
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = SemThreadSupport.create(Int count, params);
// Create an instance-object
ARGUMENTS
count
initial semaphore count
params
per-instance config params, or NULL to select default values (target-domain only)
eb
active error-handling block, or NULL to select default policy (target-domain only)
DETAILS
This function creates a new Semaphore object which is initialized to
count.