Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWThreadSelf

Module:  Threads   Package:  Threading


RWThreadSelf RWRunnableSelf

Local Index

Members

Header File

#include <rw/thread/RWThreadSelf.h>          // for RWThreadSelf
#include <rw/thread/RWRunnableSelf.h>        // for ::rwThread()

Description

The RWThreadSelf class is a handle class for a threaded runnable object.

A threaded runnable object provides the basic mechanisms used to create, control, and monitor the threads of execution within your application. Threaded runnables create their own thread to perform some task or activity.

Each threaded runnable object is reference-counted; a threaded runnable body instance keeps a count of the number of handles that currently reference it. A runnable object is deleted when the last handle that references the body is deleted.

The public interface for a threaded runnable is provided by its handle classes. Many of the public functions in a handle simply forward control to a corresponding protected function in the body class. A threaded runnable handle class instance may be empty. Any attempt to use an empty handle to access a threaded runnable will produce an RWTHRInvalidPointer exception.

The RWThreadSelf class provides an interface for the thread executing inside of a threaded runnable. It defines the member functions that may only be executed by the internal thread. Threads executing outside of a threaded runnable should access the runnable using the RWThread handle class. Those functions that may be accessed from either inside or outside of a threaded runnable are defined in both handle classes.

To retrieve an RWThreadSelf handle instance for the current threaded runnable, use the rwThread() function. You may also convert an RWThread handle to an RWThreadSelf handle by calling the RWThread::getThreadSelf() member, but any attempt to violate the thread access restrictions imposed by the separate interfaces will generally result in an RWTHRIllegalAccess exception.

Static Member Functions

bool
canGetMaxThreads();
bool
canSuspendResume();
size_t
getMaxThreads();

Public Constructors

RWThreadSelf();
RWThreadSelf(RWStaticCtor);
RWThreadSelf(const RWThreadSelf& second);

Public Destructor

~RWThreadSelf();

Public Member Operator

RWThreadSelf&
operator=(const RWThreadSelf& second)

Public Member Function

bool
canGetPriority() const;
bool
canGetProcessScopePriority() const;
bool
canGetSchedulingPolicy() const;
bool
canGetSystemScopePriority() const;
bool
canGetTimeSliceQuantum() const;
bool
canSetPriority() const;
bool
canSetProcessScopePriority() const;
bool
canSetSchedulingPolicy(RWSchedulingPolicy policy) const;
bool
canSetSystemScopePriority() const;
bool
canSetTimeSliceQuantum() const;
RWThreadAttribute
getActiveAttribute() const;
RWThreadAttribute
getAttribute() const;
RWPriority
getMaxPriority() const;
RWPriority
getMaxProcessScopePriority() const;
RWPriority
getMaxSystemScopePriority() const;
unsigned long
getMaxTimeSliceQuantum() const;
RWPriority
getMinPriority() const;
RWPriority
getMinProcessScopePriority() const;
RWPriority
getMinSystemScopePriority() const;
unsigned long
getMinTimeSliceQuantum() const;
RWPriority
getPriority() const;
RWPriority
getProcessScopePriority() const;
RWThread
getRWThread() const;
RWSchedulingPolicy
getSchedulingPolicy() const;
RWPriority
getSystemScopePriority() const;
unsigned long
getTimeSliceQuantum() const;
void
setAttribute(const RWThreadAttribute& second);
void
setPriority(RWPriority priority);
void
setProcessScopePriority(RWPriority priority);
void
setSchedulingPolicy(RWSchedulingPolicy policy);
void
setSystemScopePriority(RWPriority priority);
void
setTimeSliceQuantum(unsigned long milliseconds);
unsigned
suspend();

Protected Constructors

RWThreadSelf(const RWThread& second);

See Also

RWThread, RWRunnableSelf, RWRunnableHandle, RWThreadAttribute



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.