summaryrefslogtreecommitdiffstats
path: root/src/engine/ConnectionImpl.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-05 03:51:50 +0000
committerDavid Robillard <d@drobilla.net>2010-01-05 03:51:50 +0000
commitc67392abf59b500fe405101d7ad896d9da869e47 (patch)
tree53b5d5b27d4389caa123c5deb2a1e0aadf180ec7 /src/engine/ConnectionImpl.hpp
parent4c32f20699db0ede850a9485271dfda779761fac (diff)
downloadingen-c67392abf59b500fe405101d7ad896d9da869e47.tar.gz
ingen-c67392abf59b500fe405101d7ad896d9da869e47.tar.bz2
ingen-c67392abf59b500fe405101d7ad896d9da869e47.zip
Realtime safe buffer reference handling.
Turns out that dropping a shared_ptr is not realtime safe, even if you use a realtime safe deleter. Instead, instrusive_ptr is used for buffer references, so a buffer reference may safely be dropped in the audio thread (in which case it will be recycled by the BufferFactory). Faster, cleaner, better. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2341 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/ConnectionImpl.hpp')
-rw-r--r--src/engine/ConnectionImpl.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/engine/ConnectionImpl.hpp b/src/engine/ConnectionImpl.hpp
index 9daea1f1..63d2ecc4 100644
--- a/src/engine/ConnectionImpl.hpp
+++ b/src/engine/ConnectionImpl.hpp
@@ -70,7 +70,7 @@ public:
* buffer, and will return accordingly (e.g. the same buffer for every
* voice in a mono->poly connection).
*/
- inline SharedPtr<Buffer> buffer(uint32_t voice) const {
+ inline BufferFactory::Ref buffer(uint32_t voice) const {
if (must_mix() || must_queue()) {
return _local_buffer;
} else if ( ! _src_port->polyphonic()) {
@@ -95,11 +95,11 @@ protected:
Raul::RingBuffer<LV2_Object>* _queue;
- BufferFactory& _bufs;
- PortImpl* const _src_port;
- PortImpl* const _dst_port;
- SharedPtr<Buffer> _local_buffer;
- bool _pending_disconnection;
+ BufferFactory& _bufs;
+ PortImpl* const _src_port;
+ PortImpl* const _dst_port;
+ BufferFactory::Ref _local_buffer;
+ bool _pending_disconnection;
};