ORIGINAL
Loading...
Searching...
No Matches
original::pThread Class Referencefinal

POSIX thread implementation. More...

#include <thread.h>

Inheritance diagram for original::pThread:
Inheritance graph
Collaboration diagram for original::pThread:
Collaboration graph

Public Member Functions

 pThread ()
 Construct empty (invalid) thread.
 
template<typename Callback, typename... ARGS>
 pThread (Callback c, ARGS &&... args)
 Construct and start POSIX thread.
 
 pThread (pThread &&other) noexcept
 
pThreadoperator= (pThread &&other) noexcept
 
void join ()
 Wait for thread to complete.
 
void detach ()
 Detach thread (allow it to run independently)
 
- Public Member Functions inherited from original::threadBase
virtual ~threadBase () noexcept(false)
 Destructor.
 
 threadBase (const threadBase &)=delete
 
threadBaseoperator= (const threadBase &)=delete
 
 threadBase (threadBase &&other) noexcept=default
 
threadBaseoperator= (threadBase &&other) noexcept=default
 
 operator bool () const
 Check if thread is valid.
 
bool operator! () const
 Check if thread is not valid.
 
bool joinable () const
 Check if thread is joinable.
 

Additional Inherited Members

- Protected Member Functions inherited from original::threadBase
 threadBase (bool is_joinable=false)
 Construct thread base.
 
- Protected Attributes inherited from original::threadBase
bool is_joinable
 

Detailed Description

POSIX thread implementation.

Wrapper around pthread with RAII semantics

Constructor & Destructor Documentation

◆ pThread()

template<typename Callback, typename... ARGS>
original::pThread::pThread ( Callback c,
ARGS &&... args )
explicit

Construct and start POSIX thread.

Template Parameters
CallbackCallback function type
ARGSArgument types for callback
Parameters
cCallback function
argsArguments to forward to callback
Exceptions
sysErrorif thread creation fails

Member Function Documentation

◆ detach()

void original::pThread::detach ( )
inline

Detach thread (allow it to run independently)

Exceptions
sysErrorif detach fails

◆ join()

void original::pThread::join ( )
inline

Wait for thread to complete.

Exceptions
sysErrorif join fails

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