Provides semaphore services when an ISemaphore.Handle is available.
[EXPERIMENTAL]
proxy Semaphore.Proxy |
![](../../../Arrow_up.png) |
Proxy used for optimization
XDCscript usage |
meta-domain |
// some delegate module inheriting the
ISemaphore interface
Semaphore.
Proxy.delegate$ =
ISemaphore.Module null
// explicit access to the currently bound delegate module
Semaphore.Proxy.abstractInstances$ = false
// use indirect runtime function calls if true
DETAILS
If ALL ISemaphore.Handles were created using the same module
(e.g SemProcess) then setting this Proxy to SemProcess and
setting Semaphore.Proxy.abstractInstances$ = false,
Semaphore APIs can have better performance.
const Semaphore.FOREVER |
![](../../../Arrow_up.png) |
Used as the timeout value to specify wait forever
XDCscript usage |
meta-domain |
enum Semaphore.PendStatus |
![](../../../Arrow_up.png) |
Error codes returned by Semaphore_pend
XDCscript usage |
meta-domain |
values of type Semaphore.PendStatus
const Semaphore.PendStatus_ERROR;
const Semaphore.PendStatus_TIMEOUT;
const Semaphore.PendStatus_SUCCESS;
typedef enum Semaphore_PendStatus {
Semaphore_PendStatus_ERROR,
Semaphore_PendStatus_TIMEOUT,
Semaphore_PendStatus_SUCCESS
} Semaphore_PendStatus;
metaonly config Semaphore.common$ // module-wide |
![](../../../Arrow_up.png) |
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.
Semaphore.pend( ) // module-wide |
![](../../../Arrow_up.png) |
Wait for the semaphore to have a nonzero count, then decrement it
ARGUMENTS
sem
ISemaphore.Handle to be used
timeout
timeout in microseconds
eb
Pointer to Error.Block
DETAILS
RETURNS
status returned. (refer to above description)
Semaphore.post( ) // module-wide |
![](../../../Arrow_up.png) |
Increment the semaphore count
ARGUMENTS
sem
ISemaphore.Handle to be used
eb
Pointer to Error.Block
RETURNS
true for success, false for error in Error block.
module-wide built-ins |
![](../../../Arrow_up.png) |
// Get this module's unique id
Bool Semaphore_Module_startupDone( );
// Test if this module has completed startup
// The heap from which this module allocates memory