Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWExecutionState


Global Enumerator

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

Data Types

Package

Threading

Header File

#include <rw/thread/RWRunnableHandle.h>

Description

RWExecutionState values describe the execution states of a runnable object. These values are returned by the getExecutionState() member functions of all runnable handles. A newly constructed runnable will start in RW_THR_INITIAL. After the user calls start() on the runnable handle, but before the target executable code is executed, the runnable will be in RW_THR_STARTING. While the runnable is executing its executable code, the runnable will be in RW_THR_RUNNING. After the runnable finishes, it will return to RW_THR_INITIAL.

The other RWExecutionState values correspond to operations made through the runnable's handle. A runnable will only enter the RW_THR_YIELDING or RW_THR_SLEEPING states if the runnable handle's methods are called to yield or sleep. The global functions rwYield() or rwSleep() will not change the state of the runnable.

Declaration

enum RWExecutionState {
  RW_THR_INITIAL     = 0x0001, // Constructed; waiting for start 
                            // or restart
  RW_THR_STARTING    = 0x0002, // Runnable started, but not executing
  RW_THR_RUNNING     = 0x0004, // Active, executing
  RW_THR_INTERRUPTED = 0x0008, // Active; Waiting for
                               // releaseInterrupt()
  RW_THR_SUSPENDED   = 0x0010, // Active; Waiting for resume()
  RW_THR_SLEEPING    = 0x0020, // Active; Waiting for end of sleep.
  RW_THR_YIELDING    = 0x0040, // Active; Yielded execution to 
                            //other Runnables, 
                            // Waiting for execution
  RW_THR_CANCELING   = 0x0080, // Active; Cancellation in progress.
  RW_THR_ABORTING    = 0x0100, // Active; Aborting cancellation 
  RW_THR_TERMINATING = 0x0200, // Active; RWThreadImp terminating.
  RW_THR_EXCEPTION   = 0x0400, // Active; Exiting with an exception
  RW_THR_SERVER_WAIT = 0x0800, // Active; Server waiting for 
                            // another Runnable to execute 
};


Previous fileTop of DocumentContentsIndexNext file

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