|
VTK
9.4.2
|
Proxy class used to submit work to the thread pool. More...
#include <vtkSMPThreadPool.h>
Public Member Functions | |
| ~Proxy () | |
| Destructor. | |
| Proxy (const Proxy &)=delete | |
| Proxy & | operator= (const Proxy &)=delete |
| Proxy (Proxy &&) noexcept | |
| Proxy & | operator= (Proxy &&) noexcept |
| void | Join () |
| Blocks calling thread until all jobs are done. | |
| void | DoJob (std::function< void()> job) |
| Add a job to the thread pool queue. | |
| std::vector< std::reference_wrapper< std::thread > > | GetThreads () const |
| Get a reference on all system threads used by this proxy. | |
| bool | IsTopLevel () const noexcept |
| Return true is this proxy is allocated from a thread that does not belong to the pool. | |
Friends | |
| class | vtkSMPThreadPool |
Proxy class used to submit work to the thread pool.
A proxy act like a single thread pool, but it submits work to its parent thread pool. Using a proxy from multiple threads at the same time is undefined behaviour.
Note: Even if nothing prevent a proxy to be moved around threads, it should either be used in the creating thread or in a thread that does not belong to the pool, otherwise it may create a deadlock when joining.
Definition at line 59 of file vtkSMPThreadPool.h.
| vtk::detail::smp::vtkSMPThreadPool::Proxy::~Proxy | ( | ) |
Destructor.
Join must have been called since the last DoJob before destroying the proxy.
|
delete |
|
noexcept |
| void vtk::detail::smp::vtkSMPThreadPool::Proxy::Join | ( | ) |
Blocks calling thread until all jobs are done.
Note: nested proxies may execute jobs on calling thread during this function to maximize parallelism.
| void vtk::detail::smp::vtkSMPThreadPool::Proxy::DoJob | ( | std::function< void()> | job | ) |
Add a job to the thread pool queue.
| std::vector< std::reference_wrapper< std::thread > > vtk::detail::smp::vtkSMPThreadPool::Proxy::GetThreads | ( | ) | const |
Get a reference on all system threads used by this proxy.
|
noexcept |
Return true is this proxy is allocated from a thread that does not belong to the pool.
|
friend |
Definition at line 97 of file vtkSMPThreadPool.h.