Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
ola::thread::SignalThread Class Reference

Detailed Description

Signals and threads don't play nicely together. Consider the following:

The recommended way to deal with this is to run a separate thread, whose sole purpose is to wait for signals. See section 12.8 of APUE.

To avoid this we do the following:

Inheritance diagram for ola::thread::SignalThread:
ola::thread::Thread

Public Types

typedef ola::Callback0< void > SignalHandler

Public Member Functions

bool InstallSignalHandler (int signal, SignalHandler *handler)
- Public Member Functions inherited from ola::thread::Thread
virtual bool Start ()
virtual bool FastStart ()
virtual bool Join (void *ptr=NULL)
bool IsRunning ()
ThreadId Id () const
void * _InternalRun ()

Protected Member Functions

void * Run ()

Additional Inherited Members

- Static Public Member Functions inherited from ola::thread::Thread
static ThreadId Self ()

Member Function Documentation

bool ola::thread::SignalThread::InstallSignalHandler ( int  signal,
SignalHandler handler 
)

Install a signal handler for the given signal. This can't be called once the thread has stared.

void * ola::thread::SignalThread::Run ( )
protectedvirtual

Entry point into the thread.

Implements ola::thread::Thread.


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