Public Member Functions | Static Public Member Functions | List of all members
openmsx::Thread Class Reference

#include <Thread.hh>

Public Member Functions

 Thread (const Thread &)=delete
Threadoperator= (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...

Detailed Description

Definition at line 17 of file Thread.hh.

Constructor & Destructor Documentation

§ Thread() [1/2]

openmsx::Thread::Thread ( const Thread )

§ Thread() [2/2]

openmsx::Thread::Thread ( Runnable runnable)

Create a new thread.

runnableObject those run() method will be invoked by the created thread when it starts running.

Definition at line 25 of file

§ ~Thread()

openmsx::Thread::~Thread ( )

Definition at line 30 of file

Member Function Documentation

§ isMainThread()

bool openmsx::Thread::isMainThread ( )

§ join()

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

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().

§ operator=()

Thread& openmsx::Thread::operator= ( const Thread )

§ setMainThread()

void openmsx::Thread::setMainThread ( )

Store ID of the main thread, should be called exactly once from the main thread.

Definition at line 12 of file

§ start()

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

Referenced by openmsx::MidiInReader::plugHelper(), openmsx::RS232Tester::plugHelper(), and openmsx::PreCacheFile::PreCacheFile().

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