summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/butler.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-14 22:06:12 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-14 22:06:12 +0000
commit8783fc35f27b8583755d53d70efbf6cece27ca29 (patch)
tree50f35241556a6e4f83bf883e2516072a62db510b /libs/ardour/ardour/butler.h
parent72f8544b2411c0bb9a8a46b2d27c5e94c2c0b803 (diff)
Suspend deletion of cross-thread pools until they are empty. Prevents crashes when the freeze thread completes.
git-svn-id: svn://localhost/ardour2/branches/3.0@6893 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/butler.h')
-rw-r--r--libs/ardour/ardour/butler.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h
index 60697517fb..e9e832783b 100644
--- a/libs/ardour/ardour/butler.h
+++ b/libs/ardour/ardour/butler.h
@@ -22,11 +22,20 @@
#include <glibmm/thread.h>
+#include "pbd/ringbuffer.h"
+#include "pbd/pool.h"
#include "ardour/types.h"
#include "ardour/session_handle.h"
namespace ARDOUR {
+/**
+ * One of the Butler's functions is to clean up (ie delete) unused CrossThreadPools.
+ * When a thread with a CrossThreadPool terminates, its CTP is added to pool_trash.
+ * When the Butler thread wakes up, we check this trash buffer for CTPs, and if they
+ * are empty they are deleted.
+ */
+
class Butler : public SessionHandleRef
{
public:
@@ -67,6 +76,10 @@ class Butler : public SessionHandleRef
int request_pipe[2];
uint32_t audio_dstream_buffer_size;
uint32_t midi_dstream_buffer_size;
+ RingBuffer<CrossThreadPool*> pool_trash;
+
+private:
+ void empty_pool_trash ();
};
} // namespace ARDOUR