#include <Thread.h>
|
virtual void | run ()=0 |
| The thread will execute this method once it has been started . More...
|
|
|
static void | msleep (unsigned long msec) |
| causes the current thread to sleep for More...
|
|
Definition at line 39 of file Thread.h.
◆ Thread() [1/2]
mars::utils::Thread::Thread |
( |
| ) |
|
◆ ~Thread()
mars::utils::Thread::~Thread |
( |
| ) |
|
|
virtual |
◆ Thread() [2/2]
mars::utils::Thread::Thread |
( |
const Thread & |
| ) |
|
|
private |
◆ cancel()
void mars::utils::Thread::cancel |
( |
bool |
block = false | ) |
|
Tries to cancel the Thread.
- Parameters
-
block | If true cancel will only return when the Thread stopped. The Thread can only be canceled at certain cancellation points. Many IO related system calls are cancellation points and so is Thread::wait. You can manually add cancellation points to you run method by calling Thread::setCancelationPoint(). |
- See also
- setCancellationPoint()
Definition at line 139 of file Thread.cpp.
◆ cancelAll()
void mars::utils::Thread::cancelAll |
( |
bool |
block = false | ) |
|
|
static |
◆ cleanupHandler()
void mars::utils::Thread::cleanupHandler |
( |
void * |
context | ) |
|
|
staticprivate |
◆ getCurrentThread()
Thread * mars::utils::Thread::getCurrentThread |
( |
| ) |
|
|
static |
◆ getStackSize()
std::size_t mars::utils::Thread::getStackSize |
( |
| ) |
const |
◆ isCurrentThread()
bool mars::utils::Thread::isCurrentThread |
( |
| ) |
const |
◆ isFinished()
bool mars::utils::Thread::isFinished |
( |
| ) |
const |
◆ isRunning()
bool mars::utils::Thread::isRunning |
( |
| ) |
const |
returns true
if the Thread is running.
returns true
if the Thread was started and has not terminated (i.e. the run method has not returned yet) and was not canceled. returns false
otherwise.
- See also
- isFinished()
Definition at line 172 of file Thread.cpp.
◆ join()
bool mars::utils::Thread::join |
( |
| ) |
|
◆ msleep()
void mars::utils::Thread::msleep |
( |
unsigned long |
msec | ) |
|
|
staticprotected |
causes the current thread to sleep for
Definition at line 201 of file Thread.cpp.
◆ operator=()
◆ run()
virtual void mars::utils::Thread::run |
( |
| ) |
|
|
protectedpure virtual |
◆ runHelper()
void * mars::utils::Thread::runHelper |
( |
void * |
context | ) |
|
|
staticprivate |
◆ setCancellationPoint()
void mars::utils::Thread::setCancellationPoint |
( |
| ) |
|
Adds a cancellation point to your run method.
- See also
- cancel
Definition at line 148 of file Thread.cpp.
◆ setStackSize()
void mars::utils::Thread::setStackSize |
( |
std::size_t |
stackSize | ) |
|
◆ start()
void mars::utils::Thread::start |
( |
| ) |
|
Starts the execution of this Thread.
This will start new thread in which the run method will be executed. This method will return as soon as the thread has been set up.
- See also
- run(), wait(), wait(unsigned long)
Definition at line 103 of file Thread.cpp.
◆ wait() [1/2]
bool mars::utils::Thread::wait |
( |
| ) |
|
◆ wait() [2/2]
bool mars::utils::Thread::wait |
( |
unsigned long |
timeoutMilliseconds | ) |
|
puts the Thread to sleep for a specified amount of time.
- Parameters
-
timeoutMilliseconds | The time the Thread shall sleep in milliseconds |
- See also
- wait(), cancel()
Definition at line 164 of file Thread.cpp.
◆ finished
bool mars::utils::Thread::finished |
|
private |
◆ myStackSize
std::size_t mars::utils::Thread::myStackSize |
|
private |
◆ myThread
◆ running
bool mars::utils::Thread::running |
|
private |
◆ threadListMutex
Mutex mars::utils::Thread::threadListMutex |
|
staticprivate |
◆ threads
std::list< Thread * > mars::utils::Thread::threads |
|
staticprivate |
The documentation for this class was generated from the following files:
- /Developer/bob-learning-dev/simulation/mars/common/utils/src/Thread.h
- /Developer/bob-learning-dev/simulation/mars/common/utils/src/Thread.cpp