Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Thread Class Reference

#include <Thread.h>

Inheritance diagram for Poco::Thread:

List of all members.


Detailed Description

This class implements a platform-independent wrapper to an operating system thread.

Every Thread object gets a unique (within its process) numeric thread ID. Furthermore, a thread can be assigned a name.

Definition at line 60 of file Thread.h.


Public Types

enum  Priority {
  PRIO_LOWEST = PRIO_LOWEST_IMPL, PRIO_LOW = PRIO_LOW_IMPL, PRIO_NORMAL = PRIO_NORMAL_IMPL, PRIO_HIGH = PRIO_HIGH_IMPL,
  PRIO_HIGHEST = PRIO_HIGHEST_IMPL
}
 Thread priorities. More...

Public Member Functions

Priority getPriority () const
int id () const
 Destroys the thread.
bool isRunning () const
void join ()
 Starts the thread with the given target.
const std::string & name () const
 Returns the unique thread ID of the thread.
void setPriority (Priority prio)
 Returns the name of the thread.
void start (Runnable &target)
 Returns the thread's priority.
 Thread (const std::string &name)
 Creates a thread. Call start() to start it.
 ~Thread ()
 Creates a named thread. Call start() to start it.

Static Public Member Functions

static Threadcurrent ()
 Yields cpu to other threads.
static void sleep (long milliseconds)
 Returns true if the thread is running.
static void yield ()

Protected Member Functions

void clearTLS ()
 Returns a reference to the thread's local storage.
std::string makeName ()
 Clears the thread's local storage.
void setName (const std::string &name)
 Creates and returns a unique id for a thread.
ThreadLocalStoragetls ()

Static Protected Member Functions

static int uniqueId ()
 Creates a unique name for a thread.

Private Member Functions

int getPriorityImpl () const
int getPriorityImpl () const
bool isRunningImpl () const
bool isRunningImpl () const
void joinImpl ()
void joinImpl ()
Threadoperator= (const Thread &)
void setPriorityImpl (int prio)
void setPriorityImpl (int prio)
void startImpl (Runnable &target)
void startImpl (Runnable &target)
RunnabletargetImpl () const
 Thread (const Thread &)
 Sets the name of the thread.

Static Private Member Functions

static ThreadImpl * currentImpl ()
static ThreadImpl * currentImpl ()
static unsigned __stdcall entry (void *pThread)
static void * entry (void *pThread)
static int mapPrio (int prio)
static void sleepImpl (long milliseconds)
static void sleepImpl (long milliseconds)
static void yieldImpl ()
static void yieldImpl ()

Private Attributes

int _id
std::string _name
ThreadLocalStorage_pTLS

Friends

class PooledThread
class ThreadLocalStorage

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index