#include <Thread.h>

Public Member Functions | |
| void | setPriority (void) |
| virtual void | run (void)=0 |
| virtual | ~Thread () |
| virtual void | exit (void) |
Static Public Member Functions | |
| static void | yield (void) |
| static void | sleep (size_t timeout) |
| static void | concurrency (int level) |
| static bool | equal (pthread_t thread1, pthread_t thread2) |
| static pthread_t | self (void) |
Protected Member Functions | |
| Thread (size_t stack=0) | |
Protected Attributes | |
| pthread_t | tid |
| size_t | stack |
| int | priority |
Definition at line 26 of file Thread.h.
| ibrcommon::Thread::Thread | ( | size_t | stack = 0 |
) | [protected] |
Create a thread object that will have a preset stack size. If 0 is used, then the stack size is os defined/default.
| stack | size to use or 0 for default. |
Definition at line 29 of file Thread.cpp.
| ibrcommon::Thread::~Thread | ( | ) | [virtual] |
Destroy thread object, thread-specific data, and execution context.
Definition at line 70 of file Thread.cpp.
| void ibrcommon::Thread::setPriority | ( | void | ) |
Set thread priority without disrupting scheduling if possible. Based on scheduling policy. It is recommended that the process is set for realtime scheduling, and this method is actually for internal use.
Definition at line 35 of file Thread.cpp.
| void ibrcommon::Thread::yield | ( | void | ) | [static] |
Yield execution context of the current thread. This is a static and may be used anywhere.
Definition at line 38 of file Thread.cpp.
Referenced by dtn::net::UDPConvergenceLayer::componentRun(), dtn::net::IPNDAgent::componentRun(), dtn::net::HTTPConvergenceLayer::componentRun(), dtn::net::GenericServer< dtn::daemon::ClientHandler >::componentRun(), dtn::core::WallClock::componentRun(), dtn::routing::NeighborRoutingExtension::run(), and dtn::daemon::ClientHandler::run().
| void ibrcommon::Thread::sleep | ( | size_t | timeout | ) | [static] |
Sleep current thread for a specified time period.
| timeout | to sleep for in milliseconds. |
Definition at line 56 of file Thread.cpp.
Referenced by dtn::core::WallClock::componentRun().
| virtual void ibrcommon::Thread::run | ( | void | ) | [pure virtual] |
Abstract interface for thread context run method.
Implemented in ibrcommon::Timer, ibrcommon::SimpleTimer, ibrcommon::MultiTimer, dtn::daemon::ClientHandler, dtn::daemon::IndependentComponent, dtn::core::SQLiteBundleStorage, dtn::routing::EpidemicRoutingExtension, and dtn::routing::NeighborRoutingExtension.
| void ibrcommon::Thread::exit | ( | void | ) | [virtual] |
Exit the thread context. This function should NO LONGER be called directly to exit a running thread. Instead this method will only be used to modify the behavior of the thread context at thread exit, including detached threads which by default delete themselves. This documented usage was changed to support Mozilla NSPR exit behavior in case we support NSPR as an alternate thread runtime in the future.
Definition at line 74 of file Thread.cpp.
Referenced by ibrcommon::JoinableThread::join().
| void ibrcommon::Thread::concurrency | ( | int | level | ) | [static] |
Used to specify scheduling policy for threads above priority "0". Normally we apply static realtime policy SCHED_FIFO (default) or SCHED_RR. However, we could apply SCHED_OTHER, etc. Set concurrency level of process. This is essentially a portable wrapper for pthread_setconcurrency.
Definition at line 49 of file Thread.cpp.
| bool ibrcommon::Thread::equal | ( | pthread_t | thread1, | |
| pthread_t | thread2 | |||
| ) | [static] |
Determine if two thread identifiers refer to the same thread.
| thread1 | to test. | |
| thread2 | to test. |
Definition at line 79 of file Thread.cpp.
Referenced by ibrcommon::JoinableThread::join().
| static pthread_t ibrcommon::Thread::self | ( | void | ) | [inline, static] |
pthread_t ibrcommon::Thread::tid [protected] |
Definition at line 29 of file Thread.h.
Referenced by ibrcommon::JoinableThread::join(), and ibrcommon::JoinableThread::start().
size_t ibrcommon::Thread::stack [protected] |
Definition at line 30 of file Thread.h.
Referenced by ibrcommon::JoinableThread::JoinableThread(), ibrcommon::JoinableThread::start(), and Thread().
int ibrcommon::Thread::priority [protected] |
Definition at line 31 of file Thread.h.
Referenced by ibrcommon::JoinableThread::start(), dtn::core::SQLiteBundleStorage::store(), and Thread().
1.5.6