Block-Structured AMR Software Framework
amrex::BackgroundThread Class Reference

#include <AMReX_BackgroundThread.H>

Public Member Functions

 BackgroundThread ()
 
 ~BackgroundThread ()
 
 BackgroundThread (BackgroundThread const &)=delete
 
 BackgroundThread (BackgroundThread &&)=delete
 
BackgroundThreadoperator= (BackgroundThread const &)=delete
 
BackgroundThreadoperator= (BackgroundThread &&)=delete
 
void Submit (std::function< void()> &&a_f)
 
void Submit (std::function< void()> const &a_f)
 
void Finish ()
 

Private Member Functions

void do_job ()
 

Private Attributes

std::unique_ptr< std::thread > m_thread
 
std::mutex m_mutx
 
std::condition_variable m_job_cond
 
std::condition_variable m_done_cond
 
std::queue< std::function< void()> > m_func
 
bool m_clearing = false
 
bool m_finalizing = false
 

Constructor & Destructor Documentation

◆ BackgroundThread() [1/3]

amrex::BackgroundThread::BackgroundThread ( )

◆ ~BackgroundThread()

amrex::BackgroundThread::~BackgroundThread ( )

◆ BackgroundThread() [2/3]

amrex::BackgroundThread::BackgroundThread ( BackgroundThread const &  )
delete

◆ BackgroundThread() [3/3]

amrex::BackgroundThread::BackgroundThread ( BackgroundThread &&  )
delete

Member Function Documentation

◆ do_job()

void amrex::BackgroundThread::do_job ( )
private

◆ Finish()

void amrex::BackgroundThread::Finish ( )

◆ operator=() [1/2]

BackgroundThread& amrex::BackgroundThread::operator= ( BackgroundThread &&  )
delete

◆ operator=() [2/2]

BackgroundThread& amrex::BackgroundThread::operator= ( BackgroundThread const &  )
delete

◆ Submit() [1/2]

void amrex::BackgroundThread::Submit ( std::function< void()> &&  a_f)

◆ Submit() [2/2]

void amrex::BackgroundThread::Submit ( std::function< void()> const &  a_f)

Member Data Documentation

◆ m_clearing

bool amrex::BackgroundThread::m_clearing = false
private

◆ m_done_cond

std::condition_variable amrex::BackgroundThread::m_done_cond
private

◆ m_finalizing

bool amrex::BackgroundThread::m_finalizing = false
private

◆ m_func

std::queue<std::function<void()> > amrex::BackgroundThread::m_func
private

◆ m_job_cond

std::condition_variable amrex::BackgroundThread::m_job_cond
private

◆ m_mutx

std::mutex amrex::BackgroundThread::m_mutx
private

◆ m_thread

std::unique_ptr<std::thread> amrex::BackgroundThread::m_thread
private

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