IBR-DTNSuite
0.12
|
#include <Thread.h>
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 () |
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.
|
protected |
Create a detached thread with a known context stack size.
size | of stack for thread context or 0 for default. |
Definition at line 360 of file Thread.cpp.
|
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 364 of file Thread.cpp.
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.
priority | to start thread with. |
Definition at line 368 of file Thread.cpp.
References ibrcommon::Thread::__execute__().
Referenced by dtn::api::ApiServer::componentRun(), and dtn::net::TCPConnection::initialize().
void ibrcommon::DetachedThread::stop | ( | ) | ||
throw | ( | ThreadException | ||
) |
Stop the execution of child context.
Definition at line 451 of file Thread.cpp.
References ibrcommon::Thread::cancel().
Referenced by dtn::net::TCPConnection::eventTimeout(), and dtn::net::TCPConnection::shutdown().