diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-10-13 17:18:42 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-10-13 17:18:54 -0400 |
commit | 8f9a9523d2161ee15975f5f9136ef80d4bfbf3e2 (patch) | |
tree | fa82656ffa02c7e9d8a959803f501ab95fcbd482 /libs/ardour/ardour/port_manager.h | |
parent | 1552547f650a82487ac72615c8533fd25b4ffc39 (diff) |
new scheme for managing port deletion
shared_ptr<Port> now uses a deleter functor which pushes Port* to a lock-free FIFO so that the Port is
always deleted (and thus unregistered with the PortEngine/backend) in a safe context w.r.t. various
callbacks in the host. Currently the auto_connect_thread in Session has been tasked with doing these
deletions.
Diffstat (limited to 'libs/ardour/ardour/port_manager.h')
-rw-r--r-- | libs/ardour/ardour/port_manager.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h index 528063ca66..03484c598b 100644 --- a/libs/ardour/ardour/port_manager.h +++ b/libs/ardour/ardour/port_manager.h @@ -30,6 +30,7 @@ #include <boost/shared_ptr.hpp> #include "pbd/rcu.h" +#include "pbd/ringbuffer.h" #include "ardour/chan_count.h" #include "ardour/midiport_manager.h" @@ -96,6 +97,9 @@ class LIBARDOUR_API PortManager int get_ports (DataType, PortList&); void remove_all_ports (); + void clear_pending_port_deletions (); + virtual void add_pending_port_deletion (Port*) = 0; + RingBuffer<Port*>& port_deletions_pending () { return _port_deletions_pending; } /* per-Port monitoring */ @@ -141,6 +145,7 @@ class LIBARDOUR_API PortManager boost::shared_ptr<AudioBackend> _backend; SerializedRCUManager<Ports> ports; bool _port_remove_in_progress; + RingBuffer<Port*> _port_deletions_pending; boost::shared_ptr<Port> register_port (DataType type, const std::string& portname, bool input, bool async = false, PortFlags extra_flags = PortFlags (0)); void port_registration_failure (const std::string& portname); |