openMSX
|
#include <Thread.hh>
Public Member Functions | |
Thread (const Thread &)=delete | |
Thread & | operator= (const Thread &)=delete |
Thread (Runnable *runnable) | |
Create a new thread. More... | |
~Thread () | |
void | start () |
Start this thread. More... | |
void | join () |
Waits for this thread to terminate. More... | |
Static Public Member Functions | |
static void | setMainThread () |
Store ID of the main thread, should be called exactly once from the main thread. More... | |
static bool | isMainThread () |
Returns true when called from the main thread. More... | |
|
delete |
|
explicit |
|
static |
Returns true when called from the main thread.
Definition at line 18 of file Thread.cc.
Referenced by openmsx::EventDistributor::deliverEvents(), openmsx::Reactor::enterMainLoop(), openmsx::Scheduler::getCurrentTime(), openmsx::Reactor::getMotherBoard(), openmsx::GlobalCliComm::log(), openmsx::Reactor::replaceBoard(), openmsx::Reactor::switchMachine(), openmsx::GlobalCliComm::update(), openmsx::GlobalCliComm::~GlobalCliComm(), and openmsx::Scheduler::~Scheduler().
void openmsx::Thread::join | ( | ) |
Waits for this thread to terminate.
This method must be called on a started thread before it can be destructed.
Definition at line 49 of file Thread.cc.
References openmsx::MSXException::getMessage(), openmsx::FatalError::getMessage(), and openmsx::Runnable::run().
Referenced by openmsx::StdioConnection::output(), openmsx::MidiInReader::unplugHelper(), openmsx::RS232Tester::unplugHelper(), and openmsx::PreCacheFile::~PreCacheFile().
|
static |
void openmsx::Thread::start | ( | ) |
Start this thread.
It is not allowed to call this method on a running thread.
Definition at line 38 of file Thread.cc.
Referenced by openmsx::MidiInReader::plugHelper(), openmsx::RS232Tester::plugHelper(), and openmsx::PreCacheFile::PreCacheFile().