OMThread

This method is the constructor for the OMThread class. See the section Notes for detailed information.

Visibility
Public
Signatures
OMThread (int wrapThread);

OMThread(const char* const name = NULL, const long
   priority = OMOSThread::DefaultThreadPriority,
   const long stackSize = OMOSThread::DefaultStackSize,
   const long messageQueueSize =
      OMOSThread::DefaultMessageQueueSize,
   OMBoolean dynamicMessageQueue = TRUE);
Parameters for signature 1
wrapThread

Specifies whether a new operating system thread is constructed (the default, wrapThread = 0), or is a wrapper on the current thread.

A wrapper thread might be used, for example, in GUI applications where Rational® Rhapsody® creates its own thread to attach to an existing GUI thread.

Parameters for signature 2
name

Specifies a name for the thread. The default value is NULL.

priority

Specifies the thread priority.

DefaultThreadPriority is defined in os.h as follows:
static const long DefaultThreadPriority;

The default value is specified in xxos.cpp. For example, ntos.cpp specifies the following value:
const long OMOSThread::DefaultThreadPriority =
THREAD_PRIORITY_NORMAL;

stackSize

Specifies the size of the stack.

DefaultStackSize is defined in os.h as follows:
static const long DefaultStackSize;

The default value is specified in xxos.cpp. For example, ntos.cpp specifies the following value:
const long OMOSThread::DefaultStackSize = 0;

messageQueueSize

Specifies the size of the message queue.

DefaultMessageQueueSize is defined in os.h as follows:
static const long DefaultMessageQueueSize;

The default value is specified in xxos.cpp. For example, ntos.cpp specifies the following value:
const long OMOSThread::DefaultMessageQueueSize =
100;

dynamicMessageQueue

Specifies whether the message queue is dynamic. The default value is TRUE.

Notes

The message queue is an important building block for OMThread. It is used for intertask communication between Rational Rhapsody tasks (active classes). OMOSThread provides a thread-safe, unbounded message queue (FIFO) for multiple writers and one reader. The reader pends the message queue until there is a message to process.

Note the following distinctions between the different method calls:


Feedback