tbx  0.7.3
Static Public Member Functions | List of all members
PThreadGuard Class Reference

Helper class to stop pthreads from executing during event processing which is unsafe. More...

#include <pthreadguard.h>

Inheritance diagram for PThreadGuard:
tbx::PrePollListener tbx::PostEventListener

Static Public Member Functions

static void start ()
 Start the pthread guard if it is not already started. More...
 
static void stop ()
 Turns off the thread guard. More...
 

Detailed Description

Helper class to stop pthreads from executing during event processing which is unsafe.

Member Function Documentation

void PThreadGuard::start ( )
static

Start the pthread guard if it is not already started.

This should be called before the running thread is created.

Once started it stops threading during event processing as this is likely to cause a crash and calls pthread_yield after event processing to ensure running threads get a call on each event

void PThreadGuard::stop ( )
static

Turns off the thread guard.

Should only be called when there are no thread running


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