interface xdc.runtime.knl.ISync |
|
|
|
OS independent synchronization
This interface allows clients to select method of synchronization in an OS
independent way.
[
more ... ]
interface ISync { ...
instance: ...
interface ISync {
module-wide constants & types
};
module-wide config parameters
instance:
per-instance creation
per-instance functions
}
DETAILS
This interface allows clients to select method of synchronization in an OS
independent way.
Modules that require the user to pick a synchronization method, will
request a
Handle. Clients of such modules can pick a blocking
ISync implementation or a non-blocking implementation.
This interface specifies two main functions
signal and
wait. These two functions are always used in pairs in modules
that use
ISync instances. The
signal() function is used to signal
completion of an activity. The
wait() function will allow the module to
block or poll for completion of the same activity.
ISync mandates that the sync mechanism be binary and not support counters.
Although the wait() function seems meaningless in the case of
non-blocking sync, it allows modules to be written generically and support
all ISync implementations. For non-blocking ISync the wait() function
will return WaitStatus_TIMEOUT to denote timeout.
const ISync.NO_WAIT |
|
Used to specify no waiting
const ISync.Q_BLOCKING |
|
Blocking quality
const Int Q_BLOCKING = 1;
DETAILS
Implementations with this "quality" may cause the calling thread to
block;
const ISync.WAIT_FOREVER |
|
Used to wait forever
const UInt WAIT_FOREVER = ~(0);
enum ISync.WaitStatus |
|
Error codes returned by ISync_wait
enum WaitStatus {
WaitStatus_ERROR,
WaitStatus_TIMEOUT,
WaitStatus_SUCCESS
};
metaonly config ISync.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.
Instance Creation |
|
create();
// Create an instance-object
ISync.query() // instance |
|
Query for a particular quality
ARGUMENTS
qual
quality
RETURNS
TRUE or FALSE.
DETAILS
FALSE is returned if quality not supported.
ISync.signal() // instance |
|
Called at completion of an activity
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.
ISync.wait() // instance |
|
Called to wait/poll for completion of an activity
ARGUMENTS
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.
generated on Thu, 27 Sep 2012 23:21:09 GMT