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.Thread module.
const IThreadSupport.GETPRI_FAILED |
|
The error status for getPriority when an error is captured in
the Error.Block
const Int GETPRI_FAILED = -2;
const IThreadSupport.INVALID_OS_PRIORITY |
|
Invalid OS priority value
const Int INVALID_OS_PRIORITY = 0;
enum IThreadSupport.CompStatus |
|
Status returned by compareOsPriorities when an error occurs
enum CompStatus {
CompStatus_ERROR,
CompStatus_LOWER,
CompStatus_EQUAL,
CompStatus_HIGHER
};
enum IThreadSupport.Priority |
|
Thread priorities which are mapped to OS specific value by Proxy
enum Priority {
Priority_INVALID,
Priority_LOWEST,
Priority_BELOW_NORMAL,
Priority_NORMAL,
Priority_ABOVE_NORMAL,
Priority_HIGHEST
};
typedef IThreadSupport.RunFxn |
|
typedef for function that gets called when the Thread runs
typedef Void (*RunFxn)(IArg);
struct IThreadSupport.Stat |
|
Struct to hold thread statistics from stat
struct Stat {
SizeT stackSize;
SizeT stackUsed;
};
metaonly config IThreadSupport.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.
IThreadSupport.compareOsPriorities() // module-wide |
|
Compare two priority values and find out which one represents a
higher priority
Int compareOsPriorities(
Int p1,
Int p2,
Error.Block *
eb);
ARGUMENTS
p1
priority one
p2
priority two
eb
Pointer to Error.Block
DETAILS
RETURNS
Refer to description above
IThreadSupport.self() // module-wide |
|
Acquire the currently executing thread's handle
ARGUMENTS
eb
Pointer to Error.Block
DETAILS
Refer to
xdc.runtime.knl.Thread.self for more details.
RETURNS
Handle in case of success; null for error;
IThreadSupport.sleep() // module-wide |
|
Sleep for certain number of microseconds
ARGUMENTS
timeout
timeout in microseconds
eb
Pointer to Error.Block
DETAILS
RETURNS
true for success; false for failure
IThreadSupport.start() // module-wide |
|
Start threads running
ARGUMENTS
eb
Pointer to Error.Block
DETAILS
RETURNS
true for success; false for failure
IThreadSupport.yield() // module-wide |
|
Yield the currently scheduled thread
ARGUMENTS
eb
Pointer to Error.Block
DETAILS
RETURNS
true for success; false for failure
config IThreadSupport.arg // instance |
|
Thread function argument. Default is NULL
config IThreadSupport.osPriority // instance |
|
OS specific thread priority
DETAILS
Used to specify an OS specific value for priority. If set this value
takes precedence over
priority.
config IThreadSupport.priority // instance |
|
Thread priority
DETAILS
Thread defines several constants which allows applications to select
a priority in an OS independent way. Priority_LOWEST,
Priority_BELOW_NORMAL, Priority_NORMAL, Priority_ABOVE_NORMAL and
Priority_HIGHEST. These values get mapped to OS specific priorities
by the OS specific delegate.
config IThreadSupport.stackSize // instance |
|
Thread stack size. If left at zero, OS default is used
config SizeT stackSize = 0;
config IThreadSupport.tls // instance |
|
User-specified thread local storage data
Instance Creation |
|
// Create an instance-object
ARGUMENTS
fxn
function for new thread to begin execution
DETAILS
This function spawns a new thread calling the function fxn.
IThreadSupport.getOsHandle() // instance |
|
Get the OS thread handle
RETURNS
null in case of error
IThreadSupport.getOsPriority() // instance |
|
Obtain a thread's os specific priority
ARGUMENTS
eb
Pointer to Error.Block
DETAILS
For OSes that support dynamic priority boosting, the value returned
is the base priority of the thread.
RETURNS
thread priority in case of success; GETPRI_FAILED in
case of error;
IThreadSupport.getPriority() // instance |
|
Obtain a thread's priority
ARGUMENTS
eb
Pointer to Error.Block
DETAILS
RETURNS
thread priority in case of success; Priority_INVALID in
case of error;
IThreadSupport.getTls() // instance |
|
Obtain a thread's local storage pointer
RETURNS
null in case of error
IThreadSupport.join() // instance |
|
Join on a Thread
ARGUMENTS
eb
Pointer to Error.Block
DETAILS
Refer to
xdc.runtime.knl.Thread.join for more details.
RETURNS
true for success; false for failure
IThreadSupport.setOsPriority() // instance |
|
Set a thread's priority
ARGUMENTS
newPri
new thread priority
eb
Pointer to Error.Block
DETAILS
This API sets the base priority of the thread on OSes that
support dynamic priority boosting
RETURNS
true for success; false for failure
IThreadSupport.setPriority() // instance |
|
Set a thread's priority
ARGUMENTS
newPri
new thread priority
eb
Pointer to Error.Block
DETAILS
RETURNS
true for success; false for failure
IThreadSupport.setTls() // instance |
|
Set a thread's local storage pointer
ARGUMENTS
tls
thread tls
IThreadSupport.stat() // instance |
|
Obtain a thread's stats
ARGUMENTS
buf
Pointer to Stat
eb
Pointer to Error.Block
RETURNS
true for success; false for failure