![]() |
Block-Structured AMR Software Framework
|
Utility class running deferred work on a single background thread. More...
#include <AMReX_BackgroundThread.H>
Public Member Functions | |
| BackgroundThread () | |
| Launch the worker thread and initialize synchronization primitives. | |
| ~BackgroundThread () | |
| Stop the worker thread and drain any queued work. | |
| BackgroundThread (BackgroundThread const &)=delete | |
| BackgroundThread (BackgroundThread &&)=delete | |
| BackgroundThread & | operator= (BackgroundThread const &)=delete |
| BackgroundThread & | operator= (BackgroundThread &&)=delete |
| void | Submit (std::function< void()> &&a_f) |
| Enqueue a job that will run asynchronously on the worker thread. | |
| void | Submit (std::function< void()> const &a_f) |
| void | Finish () |
| Block the caller until all queued jobs have completed. | |
Utility class running deferred work on a single background thread.
| amrex::BackgroundThread::BackgroundThread | ( | ) |
Launch the worker thread and initialize synchronization primitives.
| amrex::BackgroundThread::~BackgroundThread | ( | ) |
Stop the worker thread and drain any queued work.
|
delete |
|
delete |
| void amrex::BackgroundThread::Finish | ( | ) |
Block the caller until all queued jobs have completed.
|
delete |
|
delete |
| void amrex::BackgroundThread::Submit | ( | std::function< void()> && | a_f | ) |
Enqueue a job that will run asynchronously on the worker thread.
| a_f | Functor representing the work to execute. |
| void amrex::BackgroundThread::Submit | ( | std::function< void()> const & | a_f | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.