cwidget  0.5.17
Classes | Public Member Functions | List of all members
cwidget::threads::thread Class Reference

A system thread. More...

#include <threads.h>

Classes

class  attr
 Stores the attributes with which a thread is to be created. More...
 

Public Member Functions

template<typename F >
 thread (const F &thunk, const attr &a=attr())
 Create a new thread. More...
 
void join ()
 Wait for this thread to finish. More...
 
void cancel ()
 Cancel this thread. More...
 

Detailed Description

A system thread.

This class represents a single thread of control. It is conceptually based on the Boost thread class; like the Boost thread class, it is non-copyable.

Constructor & Destructor Documentation

◆ thread()

template<typename F >
cwidget::threads::thread::thread ( const F &  thunk,
const attr a = attr() 
)
inline

Create a new thread.

The new thread will begin execution by calling operator() on a copy of the given function object.

Parameters
thunka function object of no parameters that will be invoked to start this thread. Must be copyable.
athe attributes with which to create the new thread.

Member Function Documentation

◆ cancel()

void cwidget::threads::thread::cancel ( )
inline

Cancel this thread.

Referenced by cwidget::toplevel::post_event().

◆ join()

void cwidget::threads::thread::join ( )
inline

Wait for this thread to finish.

Referenced by cwidget::toplevel::post_event().


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