interface xdc.runtime.knl.IThreadSupport

Interface for OS specific back-end

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. [ more ... ]
XDCspec summary sourced in xdc/runtime/knl/IThreadSupport.xdc
interface IThreadSupport {  ...
// inherits xdc.runtime.IModule
instance:  ...
XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
package xdc.runtime.knl;
 
interface IThreadSupport {
module-wide constants & types
 
        CompStatus_ERROR,
        CompStatus_LOWER,
        CompStatus_EQUAL,
        CompStatus_HIGHER
    };
 
        Priority_INVALID,
        Priority_LOWEST,
        Priority_BELOW_NORMAL,
        Priority_NORMAL,
        Priority_ABOVE_NORMAL,
        Priority_HIGHEST
    };
 
 
        SizeT stackSize;
        SizeT stackUsed;
    };
module-wide config parameters
module-wide functions
 
 
instance:
per-instance config parameters
per-instance creation
per-instance functions
    Bool join// Join on a Thread(Error.Block *eb);
    Bool setOsPriority// Set a thread's priority(Int newPri, Error.Block *eb);
}
DETAILS
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.
Refer to xdc.runtime.knl.Thread for more details on the APIs.
 
const IThreadSupport.GETPRI_FAILED

The error status for getPriority when an error is captured in the Error.Block

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
const Int GETPRI_FAILED = -2;
 
 
const IThreadSupport.INVALID_OS_PRIORITY

Invalid OS priority value

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
const Int INVALID_OS_PRIORITY = 0;
 
 
enum IThreadSupport.CompStatus

Status returned by compareOsPriorities when an error occurs

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
enum CompStatus {
    CompStatus_ERROR,
    CompStatus_LOWER,
    CompStatus_EQUAL,
    CompStatus_HIGHER
};
 
 
enum IThreadSupport.Priority

Thread priorities which are mapped to OS specific value by Proxy

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
typedef Void (*RunFxn)(IArg);
 
 
struct IThreadSupport.Stat

Struct to hold thread statistics from stat

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
struct Stat {
    SizeT stackSize;
    SizeT stackUsed;
};
 
 
metaonly config IThreadSupport.common$  // module-wide

Common module configuration parameters

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
metaonly config Types.Common$ common$;
 
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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
 
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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool sleep(UInt timeout, Error.Block *eb);
 
ARGUMENTS
timeout — timeout in microseconds
eb — Pointer to Error.Block
DETAILS
Refer to xdc.runtime.knl.Thread.sleep for more details.
RETURNS
true for success; false for failure
 
IThreadSupport.start()  // module-wide

Start threads running

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool start(Error.Block *eb);
 
ARGUMENTS
eb — Pointer to Error.Block
DETAILS
Refer to xdc.runtime.knl.Thread.start for more details.
RETURNS
true for success; false for failure
 
IThreadSupport.yield()  // module-wide

Yield the currently scheduled thread

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool yield(Error.Block *eb);
 
ARGUMENTS
eb — Pointer to Error.Block
DETAILS
Refer to xdc.runtime.knl.Thread.yield for more details.
RETURNS
true for success; false for failure
 
config IThreadSupport.arg  // instance

Thread function argument. Default is NULL

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
config IArg arg = null;
 
 
config IThreadSupport.osPriority  // instance

OS specific thread priority

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
config Int osPriority = IThreadSupport.INVALID_OS_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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
 
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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
config SizeT stackSize = 0;
 
 
config IThreadSupport.tls  // instance

User-specified thread local storage data

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
config Ptr tls = null;
 
Instance Creation

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
create(IThreadSupport.RunFxn fxn);
// 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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Ptr getOsHandle();
 
RETURNS
null in case of error
 
IThreadSupport.getOsPriority()  // instance

Obtain a thread's os specific priority

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Int getOsPriority(Error.Block *eb);
 
ARGUMENTS
eb — Pointer to Error.Block
DETAILS
For OSes that support dynamic priority boosting, the value returned is the base priority of the thread.
Refer to xdc.runtime.knl.Thread.getOsPriority for more details.
RETURNS
thread priority in case of success; GETPRI_FAILED in case of error;
 
IThreadSupport.getPriority()  // instance

Obtain a thread's priority

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
IThreadSupport.Priority getPriority(Error.Block *eb);
 
ARGUMENTS
eb — Pointer to Error.Block
DETAILS
Refer to xdc.runtime.knl.Thread.getPriority for more details.
RETURNS
thread priority in case of success; Priority_INVALID in case of error;
 
IThreadSupport.getTls()  // instance

Obtain a thread's local storage pointer

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Ptr getTls();
 
RETURNS
null in case of error
 
IThreadSupport.join()  // instance

Join on a Thread

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool join(Error.Block *eb);
 
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

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool setOsPriority(Int newPri, Error.Block *eb);
 
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
Refer to xdc.runtime.knl.Thread.setOsPriority for more details.
RETURNS
true for success; false for failure
 
IThreadSupport.setPriority()  // instance

Set a thread's priority

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool setPriority(IThreadSupport.Priority newPri, Error.Block *eb);
 
ARGUMENTS
newPri — new thread priority
eb — Pointer to Error.Block
DETAILS
Refer to xdc.runtime.knl.Thread.setPriority for more details.
RETURNS
true for success; false for failure
 
IThreadSupport.setTls()  // instance

Set a thread's local storage pointer

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Void setTls(Ptr tls);
 
ARGUMENTS
tls — thread tls
 
IThreadSupport.stat()  // instance

Obtain a thread's stats

XDCspec declarations sourced in xdc/runtime/knl/IThreadSupport.xdc
Bool stat(IThreadSupport.Stat *buf, Error.Block *eb);
 
ARGUMENTS
buf — Pointer to Stat
eb — Pointer to Error.Block
RETURNS
true for success; false for failure
generated on Thu, 01 Mar 2012 16:58:45 GMT