26 #include <glibmm/threads.h>
37 Pool (std::string
name,
unsigned long item_size,
unsigned long nitems);
40 virtual void *alloc ();
41 virtual void release (
void *);
43 std::string
name()
const {
return _name; }
44 guint
available()
const {
return free_list.read_space(); }
45 guint
used()
const {
return free_list.bufsize() - available(); }
46 guint
total()
const {
return free_list.bufsize(); }
62 virtual void *
alloc ();
76 virtual void *
alloc ();
112 void flush_pending ();
113 void flush_pending_with_ev (
void*);
128 const Glib::Threads::Private<CrossThreadPool>&
key()
const {
return _key; }
130 void create_per_thread_pool (std::string
name,
unsigned long item_size,
unsigned long nitems);
137 Glib::Threads::Private<CrossThreadPool>
_key;
145 #endif // __qm_pool_h__
RingBuffer< void * > free_list
a list of pointers to free items within block
void * block
data storage area
Glib::Threads::Mutex m_lock
guint pending_size() const
virtual void release(void *)
class LIBPBD_API PerThreadPool
RingBuffer< void * > pending
PerThreadPool * parent() const
RingBuffer< CrossThreadPool * > * _trash
const Glib::Threads::Private< CrossThreadPool > & key() const
Glib::Threads::Private< CrossThreadPool > _key
Glib::Threads::Mutex _trash_mutex
Glib::Threads::Mutex m_lock