summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/pool.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-02-05 16:13:24 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-02-05 16:32:10 -0500
commit4010884a5b898e79c32984a9355c37ad0a01a67b (patch)
tree10448987fc209d2deae101147a2d2413b9ba0e62 /libs/pbd/pbd/pool.h
parent715263410430c5872677f193fdad869ff9a16567 (diff)
expand PBD::Pool API and add additional DEBUG_TRACE output.
Expanded API splits apart some CrossThreadPool functionality, and provides access to current pool status information (available(), total(), used(), pending_size())
Diffstat (limited to 'libs/pbd/pbd/pool.h')
-rw-r--r--libs/pbd/pbd/pool.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h
index a28325cebf..1c9ac81a3e 100644
--- a/libs/pbd/pbd/pool.h
+++ b/libs/pbd/pbd/pool.h
@@ -41,7 +41,10 @@ class LIBPBD_API Pool
virtual void release (void *);
std::string name() const { return _name; }
-
+ guint available() const { return free_list.read_space(); }
+ guint used() const { return free_list.bufsize() - available(); }
+ guint total() const { return free_list.bufsize(); }
+
protected:
RingBuffer<void*> free_list; ///< a list of pointers to free items within block
std::string _name;
@@ -104,7 +107,11 @@ class LIBPBD_API CrossThreadPool : public Pool
}
bool empty ();
-
+ guint pending_size() const { return pending.read_space(); }
+
+ void flush_pending ();
+ void flush_pending_with_ev (void*);
+
private:
RingBuffer<void*> pending;
PerThreadPool* _parent;