Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWRunnableSelf


RWRunnableSelf RWRunnableHandle

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Member Functions

Package

Threading

Header File

#include <rw/thread/RWRunnableSelf.h>

Description

The RWRunnableSelf class is a handle class for a runnable object.

A runnable object provides the basic mechanisms used to create, control, and monitor the threads of execution within your application. Runnables are used to define the task or activity to be performed by a thread.

Each runnable object is reference-counted; a 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 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 runnable handle class instance may be empty. Any attempt to use an empty handle to access a runnable will produce an RWTHRInvalidPointer exception.

The RWRunnableSelf class provides an interface for the thread executing inside of a runnable. It defines the runnable member functions that may only be executed by the internal thread. Threads executing outside of a runnable should access the runnable using the RWRunnable handle class. The RWRunnableHandle class defines those functions that may be accessed from either inside or outside of a runnable.

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

Public Constructors

RWRunnableSelf(void);
RWRunnableSelf(RWStaticCtor);
RWRunnableSelf(const RWRunnableSelf& second);

Public Member Operator

RWRunnableSelf&
operator=(const RWRunnableSelf& second);

Public Member Functions

RWRunnable
getRWRunnable(void) const;
RWRunnableSelf
getNestedRunnable(void) const;
void
interrupt(void);
void
serviceCancellation(void);
RWBoolean
serviceInterrupt(void);
void
sleep(unsigned long milliseconds);
void
yield(void);

See Also

RWRunnable, RWRunnableFunction, RWTRunnableIOUFunction, RWRunnableServer, RWServerPool, RWThread, RWThreadFunction, RWTThreadIOUFunction



Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.