RTI Connext Micro  Version 2.4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OSAPI Thread

Data Structures

struct  OSAPI_ThreadInfo
 Thread info. More...

Macros

#define OSAPI_ThreadHandle   HANDLE
 Abstract Thread API.
#define OSAPI_THREAD_DEFAULT_OPTIONS   0x00
#define OSAPI_THREAD_FLOATING_POINT   0x01
#define OSAPI_THREAD_STDIO   0x02
#define OSAPI_THREAD_REALTIME_PRIORITY   0x08
#define OSAPI_THREAD_PRIORITY_ENFORCE   0x10
#define OSAPI_THREAD_CANCEL_ASYNCHRONOUS   0x20
#define OSAPI_THREAD_PROPERTY_DEFAULT

Typedefs

typedef RTI_UINT32 OSAPI_ThreadOptions
typedef RTI_BOOL(* OSAPI_ThreadRoutine )(struct OSAPI_ThreadInfo *thread_info)
 Thread task signature.

Functions

RTI_BOOL OSAPI_Thread_wakeup (struct OSAPI_Thread *self)
 Wakeup user-thread.
RTI_BOOL OSAPI_Thread_start (struct OSAPI_Thread *me)
 Start a specific thread.
RTI_BOOL OSAPI_Thread_destroy (struct OSAPI_Thread *self)
 Destroy a specific thread.
void OSAPI_Thread_sleep (RTI_UINT32 ms)
 Suspend a thread for a specified amount of time.
struct OSAPI_Thread * OSAPI_Thread_create (const char *name, const struct OSAPI_ThreadProperty *properties, OSAPI_ThreadRoutine user_routine, void *user_data, OSAPI_ThreadRoutine wakeup_routine)
 Create a thread.
OSAPI_ThreadId OSAPI_Thread_self (void)
 Return thread ID.

Detailed Description


Macro Definition Documentation

#define OSAPI_ThreadHandle   HANDLE

Abstract Thread API.

#define OSAPI_THREAD_DEFAULT_OPTIONS   0x00

Use only the default options the OS gives you.

#define OSAPI_THREAD_FLOATING_POINT   0x01

Support floating point.

#define OSAPI_THREAD_STDIO   0x02

Support standard I/O.

#define OSAPI_THREAD_REALTIME_PRIORITY   0x08

Run in real-time priority mode.

#define OSAPI_THREAD_PRIORITY_ENFORCE   0x10

Insist on the specified priority and fail if the OS doesn't like it.

#define OSAPI_THREAD_CANCEL_ASYNCHRONOUS   0x20

Support the ability to asynchronously cancel the thread.

#define OSAPI_THREAD_PROPERTY_DEFAULT
Value:
{ \
OSAPI_THREAD_USE_OSDEFAULT_STACKSIZE, \
OSAPI_THREAD_PRIORITY_NORMAL, \
OSAPI_THREAD_DEFAULT_OPTIONS \
}

Initializer for thread properties


Typedef Documentation

typedef RTI_UINT32 OSAPI_ThreadOptions

Thread options

typedef RTI_BOOL(* OSAPI_ThreadRoutine)(struct OSAPI_ThreadInfo *thread_info)

Thread task signature.

Parameters:
[in]thread_infoThread information structure
Returns:
RTI_TRUE on successful execution, RTI_FALSE on failure.

Function Documentation

RTI_BOOL OSAPI_Thread_wakeup ( struct OSAPI_Thread *  self)

Wakeup user-thread.

If a user-defined thread function is blocking, e.g. waiting for data, and the user wants to delete the thread, it is necessary to unblock the user-thread. The user must provide a function which can unblock a thread. This function call the wakup function to wakeup a block user thread.

Parameters:
[in]selfOSAPI_Thread to wakeup
Returns:
RTI_TRUE on succsess, RTI_FALSE on failure.
See also:
OSAPI_Thread_start
RTI_BOOL OSAPI_Thread_start ( struct OSAPI_Thread *  me)

Start a specific thread.

Parameters:
[in]meThread to wakeup
Returns:
RTI_TRUE on success, RTI_FALSE on failure.
See also:
Introduction, OSAPI_Thread_create
RTI_BOOL OSAPI_Thread_destroy ( struct OSAPI_Thread *  self)

Destroy a specific thread.

Parameters:
[in]selfThread.
Returns:
RTI_TRUE on success, RTI_FALSE on failure.
See also:
Introduction, OSAPI_Thread_create
void OSAPI_Thread_sleep ( RTI_UINT32  ms)

Suspend a thread for a specified amount of time.

Parameters:
[in]msSleep time.
See also:
Introduction
struct OSAPI_Thread* OSAPI_Thread_create ( const char *  name,
const struct OSAPI_ThreadProperty *  properties,
OSAPI_ThreadRoutine  user_routine,
void *  user_data,
OSAPI_ThreadRoutine  wakeup_routine 
)
read

Create a thread.

Parameters:
[in]nameThe name of the thread.
[in]propertiesThread properties. These properties are hints.
[in]user_routineThread task. The thread task cannot assume that it can block; thus it must be written such that it can be called repeatedly.
[in]user_dataParameters passed to the thread task.
[in]wakeup_routineRoutine to wakeup a thread, called to delete a thread.
Returns:
Handle to stopped thread on success, NULL on failure.
See also:
Introduction, OSAPI_Thread_destroy
OSAPI_ThreadId OSAPI_Thread_self ( void  )

Return thread ID.

Returns:
thread ID of the calling thread.
See also:
Introduction, OSAPI_Thread_create

RTI Connext Micro Version 2.4.1.0 Copyright © Thu Nov 20 2014 Real-Time Innovations, Inc