Honeycomb  0.1
Component-Model Framework
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
honey::Thread Class Reference

Thread class. More...

#include <Thread.h>

Inheritance diagram for honey::Thread:
Inheritance graph
[legend]
Collaboration diagram for honey::Thread:
Collaboration graph
[legend]

Public Types

typedef Super::ThreadId ThreadId
 
typedef function< void()> Entry
 

Public Member Functions

 Thread (const Entry &entry, int stackSize=0)
 Construct a thread. More...
 
 Thread (Thread &&rhs) noexcept
 Thread is moveable. More...
 
virtual ~Thread ()
 
Threadoperator= (Thread &&rhs)
 
void start ()
 Begin execution of this thread. The entry function will be called. More...
 
void join ()
 Wait until thread execution is complete. More...
 
bool join (MonoClock::Duration time)
 Try to join for an amount of time. Returns true if joined and thread execution is complete. More...
 
bool join (MonoClock::TimePoint time)
 Try to join until a specific time. Returns true if joined and thread execution is complete. More...
 
void interrupt (const Exception::ConstPtr &e=new thread::Interrupted)
 Request an interrupt in the thread. More...
 
bool interruptRequested () const
 Check whether an interrupt has been requested for the thread. More...
 
void setPriority (int priority)
 Set thread execution scheduling priority. More...
 
int getPriority () const
 Get thread execution scheduling priority. More...
 
ThreadId threadId () const
 Get the thread unique platform id. More...
 

Static Public Member Functions

static Threadcurrent ()
 Get the thread object of the calling thread. More...
 
static int concurrency ()
 Get number of threads that can be executed concurrently on the device. More...
 
Thread scheduling priority

Higher priority threads are favored for scheduling and will execute more often.

static int priorityNormal ()
 
static int priorityMin ()
 
static int priorityMax ()
 

Static Public Attributes

static const ThreadId threadIdInvalid = Super::threadIdInvalid
 Invalid thread id. More...
 

Friends

class platform::Thread
 
template<class T >
class thread::Local
 
struct thread::InterruptEnable
 
class thread::priv::InterruptWait
 
void thread::current::sleep (MonoClock::TimePoint time)
 
bool thread::current::interruptEnabled ()
 
void thread::current::interruptPoint ()
 

Detailed Description

Thread class.

Member Typedef Documentation

typedef function<void ()> honey::Thread::Entry
typedef Super::ThreadId honey::Thread::ThreadId

Constructor & Destructor Documentation

honey::Thread::Thread ( const Entry entry,
int  stackSize = 0 
)

Construct a thread.

Parameters
entryExecution function for thread.
stackSizeInitial size of the thread stack in bytes. If 0 then default size is used.
honey::Thread::Thread ( Thread &&  rhs)
noexcept

Thread is moveable.

honey::Thread::~Thread ( )
virtual

Member Function Documentation

static int honey::Thread::concurrency ( )
inlinestatic

Get number of threads that can be executed concurrently on the device.

static Thread& honey::Thread::current ( )
inlinestatic

Get the thread object of the calling thread.

int honey::Thread::getPriority ( ) const
inline

Get thread execution scheduling priority.

void honey::Thread::interrupt ( const Exception::ConstPtr &  e = new thread::Interrupted)

Request an interrupt in the thread.

The thread will throw e the next time it waits in join(), current::sleep(), current::interruptPoint(), or Condition::wait().

bool honey::Thread::interruptRequested ( ) const

Check whether an interrupt has been requested for the thread.

void honey::Thread::join ( )
inline

Wait until thread execution is complete.

bool honey::Thread::join ( MonoClock::Duration  time)
inline

Try to join for an amount of time. Returns true if joined and thread execution is complete.

bool honey::Thread::join ( MonoClock::TimePoint  time)

Try to join until a specific time. Returns true if joined and thread execution is complete.

Thread & honey::Thread::operator= ( Thread &&  rhs)
static int honey::Thread::priorityMax ( )
inlinestatic
static int honey::Thread::priorityMin ( )
inlinestatic
static int honey::Thread::priorityNormal ( )
inlinestatic
void honey::Thread::setPriority ( int  priority)
inline

Set thread execution scheduling priority.

void honey::Thread::start ( )

Begin execution of this thread. The entry function will be called.

ThreadId honey::Thread::threadId ( ) const
inline

Get the thread unique platform id.

Friends And Related Function Documentation

friend class platform::Thread
friend
friend struct thread::InterruptEnable
friend
template<class T >
friend class thread::Local
friend
friend class thread::priv::InterruptWait
friend

Member Data Documentation

const Thread::ThreadId honey::Thread::threadIdInvalid = Super::threadIdInvalid
static

Invalid thread id.


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