Public Member Functions | Protected Attributes | List of all members
ana::ThreadPool::TaskQueue Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cafanacore/v01.11/src/CAFAna/Core/ThreadPool.h"

Inheritance diagram for ana::ThreadPool::TaskQueue:

Public Member Functions

void add (const func_t &x)
 
func_t consume ()
 Null if the queue is empty. More...
 

Protected Attributes

std::mutex fLock
 

Detailed Description

Definition at line 47 of file ThreadPool.h.

Member Function Documentation

void ana::ThreadPool::TaskQueue::add ( const func_t x)
inline

Definition at line 50 of file ThreadPool.h.

References fLock, and push_back().

Referenced by ana::ThreadPool::AddTask().

51  {
52  std::scoped_lock lock(fLock);
54  }
base_types push_back(int_type())
func_t ana::ThreadPool::TaskQueue::consume ( )
inline

Null if the queue is empty.

Definition at line 57 of file ThreadPool.h.

References fLock, and runNovaSAM::ret.

Referenced by ana::ThreadPool::WorkerFunc().

58  {
59  std::scoped_lock lock(fLock);
60  if(empty()) return 0;
61  func_t ret = front();
62  pop_front();
63  return ret;
64  }
std::function< void(void)> func_t
The type of the user&#39;s worker functions.
Definition: ThreadPool.h:33

Member Data Documentation

std::mutex ana::ThreadPool::TaskQueue::fLock
protected

Definition at line 67 of file ThreadPool.h.

Referenced by add(), and consume().


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