A ISync implementation based on a SemThread. [EXPERIMENTAL]
const SyncSemThread_NO_WAIT |
|
Used to specify no waiting
#define SyncSemThread_NO_WAIT (UInt)0
const SyncSemThread_Q_BLOCKING |
|
Blocking quality
#define SyncSemThread_Q_BLOCKING (Int)1
DETAILS
Implementations with this "quality" may cause the calling thread to
block;
const SyncSemThread_WAIT_FOREVER |
|
Used to wait forever
#define SyncSemThread_WAIT_FOREVER (UInt)~(0)
enum SyncSemThread_WaitStatus |
|
Error codes returned by ISync_wait
typedef enum SyncSemThread_WaitStatus {
SyncSemThread_WaitStatus_ERROR,
SyncSemThread_WaitStatus_TIMEOUT,
SyncSemThread_WaitStatus_SUCCESS
} SyncSemThread_WaitStatus;
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool SyncSemThread_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool SyncSemThread_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 SyncSemThread_Module_getMask();
// Returns the diagnostics mask for this module
Void SyncSemThread_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct SyncSemThread_Object SyncSemThread_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct SyncSemThread_Struct SyncSemThread_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 SyncSemThread_Params {
// Instance config-params structure
// Common per-instance configs
} SyncSemThread_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
Instance Creation |
|
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
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)
Instance Deletion |
|
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
SyncSemThread_query() // instance |
|
Query for a particular quality
ARGUMENTS
handle
handle of a previously-created SyncSemThread instance object
qual
quality
RETURNS
TRUE or FALSE.
DETAILS
FALSE is returned if quality not supported.
SyncSemThread_signal() // instance |
|
Called at completion of an activity
ARGUMENTS
handle
handle of a previously-created SyncSemThread instance object
DETAILS
This function is non-blocking. It is also required that the underlying
sync be binary in nature.
This function does not take an Error.Block intentionally because
it can be called from ISR context.
SyncSemThread_wait() // instance |
|
Called to wait/poll for completion of an activity
ARGUMENTS
handle
handle of a previously-created SyncSemThread instance object
timeout
Timeout in microseconds
eb
Hist Pointer to Error.Block
RETURNS
Refer to description above
DETAILS
This function can block. Non-blocking implementations should return
WaitStatus_TIMEOUT to indicate a timeout.
Instance Convertors |
|
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins |
|
Int SyncSemThread_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