IBR-DTNSuite  0.10
ibrcommon::DetachedThread Class Referenceabstract

#include <Thread.h>

Inheritance diagram for ibrcommon::DetachedThread:
Inheritance graph
Collaboration diagram for ibrcommon::DetachedThread:
Collaboration graph

Public Member Functions

virtual ~DetachedThread ()=0
 
void start (int priority=0) throw (ThreadException)
 
void stop () throw (ThreadException)
 

Protected Member Functions

 DetachedThread (size_t size=DEFAULT_STACKSIZE)
 
- Protected Member Functions inherited from ibrcommon::Thread
virtual ~Thread ()=0
 
void reset () throw (ThreadException)
 
virtual void setup (void) throw ()
 
virtual void run (void)=0 throw ()
 
virtual void finally (void) throw ()
 
bool isFinalized () throw ()
 
bool operator== (const ibrcommon::Thread &other)
 
 Thread (size_t stack=DEFAULT_STACKSIZE)
 
int kill (int sig)
 
void cancel () throw ()
 
virtual void __cancellation ()=0 throw ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from ibrcommon::Thread
static size_t getNumberOfProcessors ()
 
static void yield (void)
 
static void sleep (time_t timeout)
 
static void concurrency (int level)
 
static bool equal (pthread_t thread1, pthread_t thread2)
 
static void * __execute__ (void *obj) throw ()
 

Detailed Description

A detached thread object that is stand-alone. This object has no relationship with any other running thread instance will be automatically deleted when the running thread instance exits, either by it's run method exiting, or explicity calling the exit member function.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 247 of file Thread.h.

Constructor & Destructor Documentation

ibrcommon::DetachedThread::DetachedThread ( size_t  size = DEFAULT_STACKSIZE)
protected

Create a detached thread with a known context stack size.

Parameters
sizeof stack for thread context or 0 for default.

Definition at line 350 of file Thread.cpp.

ibrcommon::DetachedThread::~DetachedThread ( )
pure virtual

Destroys object when thread context exits. Never externally deleted. Derived object may also have destructor to clean up thread-specific member data.

Definition at line 354 of file Thread.cpp.

Member Function Documentation

void ibrcommon::DetachedThread::start ( int  priority = 0) throw (ThreadException)

Start execution of detached context. This must be called after the object is created (perhaps with "new"). This method actually begins the new thread context, which then calls the object's run method.

Parameters
priorityto start thread with.

Definition at line 358 of file Thread.cpp.

References ibrcommon::Thread::__execute__().

Referenced by dtn::api::ApiServer::componentRun(), and dtn::net::TCPConnection::initialize().

Here is the call graph for this function:

void ibrcommon::DetachedThread::stop ( ) throw (ThreadException)

Stop the execution of child context.

Definition at line 441 of file Thread.cpp.

References ibrcommon::Thread::cancel().

Referenced by dtn::net::TCPConnection::eventTimeout(), and dtn::net::TCPConnection::shutdown().

Here is the call graph for this function:


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