Ardour  9.0-pre0-582-g084a23a80d
PBD::PerThreadPool Class Reference

#include <pool.h>

Public Member Functions

 PerThreadPool ()
 
const Glib::Threads::Private< CrossThreadPool > & key () const
 
void create_per_thread_pool (std::string name, unsigned long item_size, unsigned long nitems, PoolDumpCallback cb=NULL)
 
CrossThreadPoolper_thread_pool (bool must_exist=true)
 
bool has_per_thread_pool ()
 
void set_trash (PBD::RingBuffer< CrossThreadPool * > *t)
 
void add_to_trash (CrossThreadPool *)
 

Private Attributes

Glib::Threads::Private< CrossThreadPool_key
 
std::string _name
 
Glib::Threads::Mutex _trash_mutex
 
PBD::RingBuffer< CrossThreadPool * > * _trash
 

Detailed Description

A class to manage per-thread pools of memory. One object of this class is instantiated, and then it is used to create per-thread pools for 1 or more threads as required.

Definition at line 148 of file pool.h.

Constructor & Destructor Documentation

◆ PerThreadPool()

PBD::PerThreadPool::PerThreadPool ( )

Member Function Documentation

◆ add_to_trash()

void PBD::PerThreadPool::add_to_trash ( CrossThreadPool )

◆ create_per_thread_pool()

void PBD::PerThreadPool::create_per_thread_pool ( std::string  name,
unsigned long  item_size,
unsigned long  nitems,
PoolDumpCallback  cb = NULL 
)

◆ has_per_thread_pool()

bool PBD::PerThreadPool::has_per_thread_pool ( )

◆ key()

const Glib::Threads::Private<CrossThreadPool>& PBD::PerThreadPool::key ( ) const
inline

Definition at line 153 of file pool.h.

◆ per_thread_pool()

CrossThreadPool* PBD::PerThreadPool::per_thread_pool ( bool  must_exist = true)

◆ set_trash()

void PBD::PerThreadPool::set_trash ( PBD::RingBuffer< CrossThreadPool * > *  t)

Member Data Documentation

◆ _key

Glib::Threads::Private<CrossThreadPool> PBD::PerThreadPool::_key
private

Definition at line 167 of file pool.h.

◆ _name

std::string PBD::PerThreadPool::_name
private

Definition at line 168 of file pool.h.

◆ _trash

PBD::RingBuffer<CrossThreadPool*>* PBD::PerThreadPool::_trash
private

Definition at line 172 of file pool.h.

◆ _trash_mutex

Glib::Threads::Mutex PBD::PerThreadPool::_trash_mutex
private

mutex to protect either changes to the _trash variable, or writes to the RingBuffer

Definition at line 171 of file pool.h.


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