Thread Class Reference

Inheritance diagram for Thread:

Inheritance graph
[legend]
Collaboration diagram for Thread:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Thread ()
 Thread (RunnablePtr runnable)
void start ()
virtual void run ()
void join ()
void setPriority (int newPriority)

Static Public Member Functions

unsigned long getCurrentThreadId ()
void sleep (long millis)
long InterlockedIncrement (volatile long *val)
long InterlockedDecrement (volatile long *val)

Protected Attributes

RunnablePtr runnable

Detailed Description

A thread is a thread of execution in a program.


Constructor & Destructor Documentation

Thread  ) 
 

Allocates a new Thread object.

Thread RunnablePtr  runnable  ) 
 

Allocates a new Thread object.


Member Function Documentation

unsigned long getCurrentThreadId  )  [static]
 

Returns the current thread identifier

long InterlockedDecrement volatile long *  val  )  [static]
 

Atomic decrement

long InterlockedIncrement volatile long *  val  )  [static]
 

Atomic increment

void join  ) 
 

Waits for this thread to die.

void run  )  [virtual]
 

If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns.

Reimplemented in FileWatchdog.

void setPriority int  newPriority  ) 
 

Changes the priority of this thread.

void sleep long  millis  )  [static]
 

Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds.

void start  ) 
 

Causes this thread to begin execution; calls the run method of this thread.

Reimplemented in FileWatchdog.


Member Data Documentation

RunnablePtr runnable [protected]
 

Thread descriptor


The documentation for this class was generated from the following files:
  • thread.h
  • thread.cpp

Copyright © 1999-2004, Apache Software Foundation