35 #ifndef _BLAZE_UTIL_THREAD_H_
36 #define _BLAZE_UTIL_THREAD_H_
57 template<
typename TT,
typename MT,
typename LT,
typename CT >
class ThreadPool;
246 template<
typename TT
262 explicit Thread( ThreadPoolType* pool );
270 template<
typename Callable,
typename... Args >
271 explicit inline Thread( Callable func, Args&&... args );
342 template<
typename TT
347 : terminated_( false )
349 , thread_ ( nullptr )
365 template<
typename TT
369 template<
typename Callable
391 template<
typename TT
417 template<
typename TT
423 return thread_->joinable();
436 template<
typename TT
455 template<
typename TT
479 template<
typename TT
489 while( pool_->executeTask() ) {}
bool hasTerminated() const
Returns whether the thread has terminated its execution.
Definition: Thread.h:459
Thread(ThreadPoolType *pool)
Starting a thread in a thread pool.
Definition: Thread.h:346
Base class for non-copyable class instances.
volatile bool terminated_
Thread termination flag.
Definition: Thread.h:308
bool joinable() const
Returns whether this is a thread of execution.
Definition: Thread.h:421
ThreadHandle thread_
Handle to the thread of execution.
Definition: Thread.h:313
void join()
Waiting for a thread of execution to complete.
Definition: Thread.h:440
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Base class for non-copyable class instances.The NonCopyable class is intended to work as a base class...
Definition: NonCopyable.h:63
void run()
Execution function for threads in a thread pool.
Definition: Thread.h:483
Implementation of a single thread of execution.
Definition: Thread.h:250
std::unique_ptr< ThreadType > ThreadHandle
Handle for a single thread.
Definition: Thread.h:256
Header file for run time assertion macros.
ThreadPoolType * pool_
Handle to the managing thread pool.
Definition: Thread.h:312
ThreadPool< TT, MT, LT, CT > ThreadPoolType
Type of the managing thread pool.
Definition: Thread.h:255
TT ThreadType
Type of the encapsulated thread.
Definition: Thread.h:254
Implementation of a thread pool.
Definition: Thread.h:57
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
~Thread()
Destructor for the Thread class.
Definition: Thread.h:395