Ardour
9.0-pre0-582-g084a23a80d
|
Class for distributing processing across several threads. More...
#include <threader.h>
Public Member Functions | |
Threader (Glib::ThreadPool &thread_pool, long wait_timeout_milliseconds=500) | |
virtual | ~Threader () |
void | add_output (typename Source< T >::SinkPtr output) |
Adds output RT safe. More... | |
void | clear_outputs () |
Clears outputs RT safe. More... | |
void | remove_output (typename Source< T >::SinkPtr output) |
Removes a specific output RT safe. More... | |
void | process (ProcessContext< T > const &c) |
Processes context concurrently by scheduling each output separately to the given thread pool. More... | |
Public Member Functions inherited from AudioGrapher::Source< DefaultSampleType > | |
virtual | ~Source () |
virtual void | add_output (SinkPtr output)=0 |
Adds an output to this source. All data generated is forwarded to output. More... | |
virtual void | remove_output (SinkPtr output)=0 |
Removes a specific output from this source. More... | |
Public Member Functions inherited from AudioGrapher::Sink< DefaultSampleType > | |
virtual | ~Sink () |
virtual void | process (ProcessContext< DefaultSampleType > const &context)=0 |
virtual void | process (ProcessContext< DefaultSampleType > &context) |
Private Types | |
typedef std::vector< typename Source< T >::SinkPtr > | OutputVec |
Private Member Functions | |
void | wait () |
void | process_output (ProcessContext< T > const &c, unsigned int output) |
Private Attributes | |
OutputVec | outputs |
Glib::ThreadPool & | thread_pool |
Glib::Threads::Mutex | wait_mutex |
Glib::Threads::Cond | wait_cond |
std::atomic< int > | readers |
long | wait_timeout |
Glib::Threads::Mutex | exception_mutex |
std::shared_ptr< ThreaderException > | exception |
Additional Inherited Members | |
Public Types inherited from AudioGrapher::Source< DefaultSampleType > | |
typedef std::shared_ptr< Sink< DefaultSampleType > > | SinkPtr |
Class for distributing processing across several threads.
Definition at line 38 of file threader.h.
|
private |
Definition at line 41 of file threader.h.
|
inline |
Constructor
RT safe
thread_pool | a thread pool from which all tasks are scheduled |
wait_timeout_milliseconds | maximum time allowed for threads to use in processing |
Definition at line 50 of file threader.h.
|
inlinevirtual |
Definition at line 57 of file threader.h.
|
inline |
Adds output
RT safe.
Definition at line 60 of file threader.h.
|
inlinevirtual |
Clears outputs
RT safe.
Implements AudioGrapher::Source< DefaultSampleType >.
Definition at line 63 of file threader.h.
|
inline |
Processes context concurrently by scheduling each output separately to the given thread pool.
Definition at line 72 of file threader.h.
|
inlineprivate |
Definition at line 105 of file threader.h.
|
inline |
Removes a specific output
RT safe.
Definition at line 66 of file threader.h.
|
inlineprivate |
Definition at line 91 of file threader.h.
|
private |
Definition at line 131 of file threader.h.
|
private |
Definition at line 130 of file threader.h.
|
private |
Definition at line 121 of file threader.h.
|
private |
Definition at line 127 of file threader.h.
|
private |
Definition at line 123 of file threader.h.
|
private |
Definition at line 125 of file threader.h.
|
private |
Definition at line 124 of file threader.h.
|
private |
Definition at line 128 of file threader.h.