From 3cd8138a419cb165f56070ace0b21a1e63ec5a43 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 25 Jul 2012 17:48:55 +0000 Subject: convert from Glib:: to Glib::Threads for all thread-related API git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/amp.cc | 2 +- libs/ardour/analyser.cc | 13 ++- libs/ardour/ardour/analyser.h | 6 +- libs/ardour/ardour/audioengine.h | 10 +-- libs/ardour/ardour/audiosource.h | 6 +- libs/ardour/ardour/auditioner.h | 4 +- libs/ardour/ardour/auto_bundle.h | 2 +- libs/ardour/ardour/automation_list.h | 2 +- libs/ardour/ardour/automation_watch.h | 6 +- libs/ardour/ardour/buffer_manager.h | 4 +- libs/ardour/ardour/bundle.h | 4 +- libs/ardour/ardour/butler.h | 6 +- libs/ardour/ardour/control_protocol_manager.h | 4 +- libs/ardour/ardour/diskstream.h | 4 +- libs/ardour/ardour/graph.h | 4 +- libs/ardour/ardour/internal_return.h | 2 +- libs/ardour/ardour/io.h | 4 +- libs/ardour/ardour/io_processor.h | 2 +- libs/ardour/ardour/location.h | 8 +- libs/ardour/ardour/logcurve.h | 4 +- libs/ardour/ardour/midi_diskstream.h | 2 +- libs/ardour/ardour/midi_model.h | 8 +- libs/ardour/ardour/midi_source.h | 2 +- libs/ardour/ardour/playlist.h | 12 +-- libs/ardour/ardour/process_thread.h | 4 +- libs/ardour/ardour/region_factory.h | 6 +- libs/ardour/ardour/route.h | 8 +- libs/ardour/ardour/session.h | 12 +-- libs/ardour/ardour/session_playlist.h | 2 +- libs/ardour/ardour/session_playlists.h | 4 +- libs/ardour/ardour/session_route.h | 2 +- libs/ardour/ardour/slave.h | 4 +- libs/ardour/ardour/source.h | 8 +- libs/ardour/ardour/source_factory.h | 6 +- libs/ardour/ardour/tempo.h | 6 +- libs/ardour/ardour/thread_buffers.h | 2 +- libs/ardour/ardour/user_bundle.h | 2 +- libs/ardour/ardour/worker.h | 16 ++-- libs/ardour/audio_diskstream.cc | 8 +- libs/ardour/audio_playlist_source.cc | 2 +- libs/ardour/audio_track.cc | 10 +-- libs/ardour/audio_unit.cc | 2 +- libs/ardour/audioengine.cc | 15 ++-- libs/ardour/audiofilesource.cc | 4 +- libs/ardour/audioregion.cc | 2 +- libs/ardour/audiosource.cc | 24 +++--- libs/ardour/auditioner.cc | 6 +- libs/ardour/auto_bundle.cc | 8 +- libs/ardour/automatable.cc | 16 ++-- libs/ardour/automation_watch.cc | 13 ++- libs/ardour/buffer_manager.cc | 6 +- libs/ardour/bundle.cc | 40 ++++----- libs/ardour/butler.cc | 6 +- libs/ardour/control_protocol_manager.cc | 16 ++-- libs/ardour/diskstream.cc | 12 +-- libs/ardour/file_source.cc | 4 +- libs/ardour/graph.cc | 6 +- libs/ardour/internal_return.cc | 8 +- libs/ardour/io.cc | 34 ++++---- libs/ardour/location.cc | 26 +++--- libs/ardour/midi_diskstream.cc | 16 ++-- libs/ardour/midi_model.cc | 6 +- libs/ardour/midi_region.cc | 4 +- libs/ardour/midi_source.cc | 4 +- libs/ardour/midi_stretch.cc | 2 +- libs/ardour/midi_track.cc | 6 +- libs/ardour/mtc_slave.cc | 4 +- libs/ardour/plugin_insert.cc | 2 +- libs/ardour/process_thread.cc | 25 +++--- libs/ardour/region.cc | 2 +- libs/ardour/region_factory.cc | 28 +++---- libs/ardour/return.cc | 2 +- libs/ardour/route.cc | 112 +++++++++++++------------- libs/ardour/session.cc | 40 ++++----- libs/ardour/session_butler.cc | 2 +- libs/ardour/session_click.cc | 4 +- libs/ardour/session_export.cc | 2 +- libs/ardour/session_playlists.cc | 24 +++--- libs/ardour/session_process.cc | 2 +- libs/ardour/session_state.cc | 20 ++--- libs/ardour/session_transport.cc | 2 +- libs/ardour/smf_source.cc | 6 +- libs/ardour/source.cc | 10 +-- libs/ardour/source_factory.cc | 14 ++-- libs/ardour/tempo.cc | 62 +++++++------- libs/ardour/track.cc | 8 +- libs/ardour/user_bundle.cc | 2 +- libs/ardour/worker.cc | 2 +- 88 files changed, 439 insertions(+), 445 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index 80dd7422e9..d68f73ef3e 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -449,7 +449,7 @@ Amp::GainControl::internal_to_user (double v) const void Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes) { - Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock am (control_lock(), Glib::Threads::TRY_LOCK); if (am.locked() && _session.transport_rolling() && _gain_control->automation_playback()) { assert (_gain_automation_buffer); diff --git a/libs/ardour/analyser.cc b/libs/ardour/analyser.cc index 730ea4169a..bf98ecc20a 100644 --- a/libs/ardour/analyser.cc +++ b/libs/ardour/analyser.cc @@ -27,8 +27,8 @@ using namespace ARDOUR; using namespace PBD; Analyser* Analyser::the_analyser = 0; -Glib::StaticMutex Analyser::analysis_queue_lock = GLIBMM_STATIC_MUTEX_INIT; -Glib::Cond* Analyser::SourcesToAnalyse = 0; +Glib::Threads::Mutex Analyser::analysis_queue_lock; +Glib::Threads::Cond Analyser::SourcesToAnalyse; list > Analyser::analysis_queue; Analyser::Analyser () @@ -49,8 +49,7 @@ analyser_work () void Analyser::init () { - SourcesToAnalyse = new Glib::Cond(); - Glib::Thread::create (sigc::ptr_fun (analyser_work), false); + Glib::Threads::Thread::create (sigc::ptr_fun (analyser_work)); } void @@ -64,9 +63,9 @@ Analyser::queue_source_for_analysis (boost::shared_ptr src, bool force) return; } - Glib::Mutex::Lock lm (analysis_queue_lock); + Glib::Threads::Mutex::Lock lm (analysis_queue_lock); analysis_queue.push_back (boost::weak_ptr(src)); - SourcesToAnalyse->broadcast (); + SourcesToAnalyse.broadcast (); } void @@ -79,7 +78,7 @@ Analyser::work () wait: if (analysis_queue.empty()) { - SourcesToAnalyse->wait (analysis_queue_lock); + SourcesToAnalyse.wait (analysis_queue_lock); } if (analysis_queue.empty()) { diff --git a/libs/ardour/ardour/analyser.h b/libs/ardour/ardour/analyser.h index 15e4220ad6..aae16e443f 100644 --- a/libs/ardour/ardour/analyser.h +++ b/libs/ardour/ardour/analyser.h @@ -1,7 +1,7 @@ #ifndef __ardour_analyser_h__ #define __ardour_analyser_h__ -#include +#include #include namespace ARDOUR { @@ -22,8 +22,8 @@ class Analyser { private: static Analyser* the_analyser; - static Glib::StaticMutex analysis_queue_lock; - static Glib::Cond* SourcesToAnalyse; + static Glib::Threads::Mutex analysis_queue_lock; + static Glib::Threads::Cond SourcesToAnalyse; static std::list > analysis_queue; static void analyse_audio_file_source (boost::shared_ptr); diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 73e40e8ab4..1c0d0f1a55 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include "pbd/rcu.h" #include "pbd/signals.h" @@ -85,7 +85,7 @@ public: int start (); bool running() const { return _running; } - Glib::Mutex& process_lock() { return _process_lock; } + Glib::Threads::Mutex& process_lock() { return _process_lock; } framecnt_t frame_rate () const; pframes_t frames_per_cycle () const; @@ -265,8 +265,8 @@ private: jack_client_t* volatile _jack; /* could be reset to null by SIGPIPE or another thread */ std::string jack_client_name; - Glib::Mutex _process_lock; - Glib::Cond session_removed; + Glib::Threads::Mutex _process_lock; + Glib::Threads::Cond session_removed; bool session_remove_pending; frameoffset_t session_removal_countdown; gain_t session_removal_gain; @@ -286,7 +286,7 @@ private: bool _pre_freewheel_mmc_enabled; int _usecs_per_cycle; bool port_remove_in_progress; - Glib::Thread* m_meter_thread; + Glib::Threads::Thread* m_meter_thread; ProcessThread* _main_thread; SerializedRCUManager ports; diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h index c6ec2a56ad..cbdcd296af 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -25,7 +25,7 @@ #include -#include +#include #include #include "ardour/source.h" @@ -118,7 +118,7 @@ class AudioSource : virtual public Source, static std::vector > _mixdown_buffers; static std::vector > _gain_buffers; - static Glib::StaticMutex _level_buffer_lock; + static Glib::Threads::Mutex _level_buffer_lock; static void ensure_buffers_for_level (uint32_t, framecnt_t); static void ensure_buffers_for_level_locked (uint32_t, framecnt_t); @@ -157,7 +157,7 @@ class AudioSource : virtual public Source, * PeaksReady means that _peaks_built cannot be changed * during the handling of the signal. */ - mutable Glib::Mutex _peaks_ready_lock; + mutable Glib::Threads::Mutex _peaks_ready_lock; PBD::FdFileDescriptor* _peakfile_descriptor; int _peakfile_fd; diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index 3650f0c92c..bdd04fcc66 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -22,7 +22,7 @@ #include -#include +#include #include "ardour/ardour.h" #include "ardour/audio_track.h" @@ -62,7 +62,7 @@ class Auditioner : public AudioTrack boost::shared_ptr the_region; framepos_t current_frame; mutable gint _auditioning; - Glib::Mutex lock; + Glib::Threads::Mutex lock; framecnt_t length; bool via_monitor; diff --git a/libs/ardour/ardour/auto_bundle.h b/libs/ardour/ardour/auto_bundle.h index b41a5d344f..d97080c089 100644 --- a/libs/ardour/ardour/auto_bundle.h +++ b/libs/ardour/ardour/auto_bundle.h @@ -21,7 +21,7 @@ #define __ardour_auto_bundle_h__ #include -#include +#include #include "ardour/bundle.h" namespace ARDOUR { diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h index 01c9d0641a..e7377d6b02 100644 --- a/libs/ardour/ardour/automation_list.h +++ b/libs/ardour/ardour/automation_list.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include "pbd/undo.h" #include "pbd/xml++.h" diff --git a/libs/ardour/ardour/automation_watch.h b/libs/ardour/ardour/automation_watch.h index bb5ef69385..6fd5a0eb65 100644 --- a/libs/ardour/ardour/automation_watch.h +++ b/libs/ardour/ardour/automation_watch.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include "pbd/signals.h" @@ -47,10 +47,10 @@ class AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr, ~AutomationWatch(); static AutomationWatch* _instance; - Glib::Thread* _thread; + Glib::Threads::Thread* _thread; bool _run_thread; AutomationWatches automation_watches; - Glib::Mutex automation_watch_lock; + Glib::Threads::Mutex automation_watch_lock; PBD::ScopedConnection transport_connection; void transport_state_change (); diff --git a/libs/ardour/ardour/buffer_manager.h b/libs/ardour/ardour/buffer_manager.h index e3ac981e63..2a8e7be6da 100644 --- a/libs/ardour/ardour/buffer_manager.h +++ b/libs/ardour/ardour/buffer_manager.h @@ -7,7 +7,7 @@ #include "ardour/chan_count.h" #include -#include +#include namespace ARDOUR { @@ -24,7 +24,7 @@ public: static void ensure_buffers (ChanCount howmany = ChanCount::ZERO); private: - static Glib::StaticMutex rb_mutex; + static Glib::Threads::Mutex rb_mutex; typedef PBD::RingBufferNPT ThreadBufferFIFO; typedef std::list ThreadBufferList; diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h index e84349c647..02845481b6 100644 --- a/libs/ardour/ardour/bundle.h +++ b/libs/ardour/ardour/bundle.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include "pbd/signals.h" @@ -134,7 +134,7 @@ class Bundle : public PBD::ScopedConnectionList /// mutex for _channel_ports and _channel_names /// XXX: is this necessary? - mutable Glib::Mutex _channel_mutex; + mutable Glib::Threads::Mutex _channel_mutex; std::vector _channel; private: diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h index 061c94d910..cdd48c3e3a 100644 --- a/libs/ardour/ardour/butler.h +++ b/libs/ardour/ardour/butler.h @@ -20,7 +20,7 @@ #ifndef __ardour_butler_h__ #define __ardour_butler_h__ -#include +#include #include "pbd/ringbuffer.h" #include "pbd/pool.h" @@ -67,8 +67,8 @@ class Butler : public SessionHandleRef }; pthread_t thread; - Glib::Mutex request_lock; - Glib::Cond paused; + Glib::Threads::Mutex request_lock; + Glib::Threads::Cond paused; bool should_run; mutable gint should_do_transport_work; int request_pipe[2]; diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h index 20358025f1..80c9668763 100644 --- a/libs/ardour/ardour/control_protocol_manager.h +++ b/libs/ardour/ardour/control_protocol_manager.h @@ -24,7 +24,7 @@ #include -#include +#include #include "pbd/stateful.h" #include "ardour/session_handle.h" @@ -81,7 +81,7 @@ class ControlProtocolManager : public PBD::Stateful, public ARDOUR::SessionHandl ControlProtocolManager (); static ControlProtocolManager* _instance; - Glib::Mutex protocols_lock; + Glib::Threads::Mutex protocols_lock; std::list control_protocols; void session_going_away (); diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index bbc3a85dbe..5d3693052d 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -250,7 +250,7 @@ class Diskstream : public SessionObject, public PublicDiskstream static framecnt_t disk_io_chunk_frames; std::vector capture_info; - mutable Glib::Mutex capture_info_lock; + mutable Glib::Threads::Mutex capture_info_lock; uint32_t i_am_the_modifier; @@ -301,7 +301,7 @@ class Diskstream : public SessionObject, public PublicDiskstream bool in_set_state; - Glib::Mutex state_lock; + Glib::Threads::Mutex state_lock; PBD::ScopedConnectionList playlist_connections; diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h index e5c03ad134..cac09d34af 100644 --- a/libs/ardour/ardour/graph.h +++ b/libs/ardour/ardour/graph.h @@ -122,8 +122,8 @@ private: bool _graph_empty; // chain swapping - Glib::Mutex _swap_mutex; - Glib::Cond _cleanup_cond; + Glib::Threads::Mutex _swap_mutex; + Glib::Threads::Cond _cleanup_cond; volatile int _current_chain; volatile int _pending_chain; volatile int _setup_chain; diff --git a/libs/ardour/ardour/internal_return.h b/libs/ardour/ardour/internal_return.h index 291b51896c..c7fe04cc42 100644 --- a/libs/ardour/ardour/internal_return.h +++ b/libs/ardour/ardour/internal_return.h @@ -48,7 +48,7 @@ class InternalReturn : public Return /** sends that we are receiving data from */ std::list _sends; /** mutex to protect _sends */ - Glib::Mutex _sends_mutex; + Glib::Threads::Mutex _sends_mutex; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index d38aa88576..69297fff04 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "pbd/fastlog.h" #include "pbd/undo.h" @@ -200,7 +200,7 @@ class IO : public SessionObject, public Latent int set_ports (const std::string& str); private: - mutable Glib::Mutex io_lock; + mutable Glib::Threads::Mutex io_lock; protected: PortSet _ports; diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h index 3d59230b26..7adfab2225 100644 --- a/libs/ardour/ardour/io_processor.h +++ b/libs/ardour/ardour/io_processor.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "pbd/undo.h" diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index 069230438e..414f332b5e 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -27,7 +27,7 @@ #include -#include +#include #include "pbd/undo.h" #include "pbd/stateful.h" @@ -181,12 +181,12 @@ class Locations : public SessionHandleRef, public PBD::StatefulDestructible PBD::Signal1 StateChanged; template void apply (T& obj, void (T::*method)(LocationList&)) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); (obj.*method)(locations); } template void apply (T1& obj, void (T1::*method)(LocationList&, T2& arg), T2& arg) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); (obj.*method)(locations, arg); } @@ -194,7 +194,7 @@ class Locations : public SessionHandleRef, public PBD::StatefulDestructible LocationList locations; Location *current_location; - mutable Glib::Mutex lock; + mutable Glib::Threads::Mutex lock; int set_current_unlocked (Location *); void location_changed (Location*); diff --git a/libs/ardour/ardour/logcurve.h b/libs/ardour/ardour/logcurve.h index a5f0ce4734..4c91ad9a79 100644 --- a/libs/ardour/ardour/logcurve.h +++ b/libs/ardour/ardour/logcurve.h @@ -21,7 +21,7 @@ #define __ardour_logcurve_h__ #include "pbd/fastlog.h" -#include +#include namespace ARDOUR { @@ -93,7 +93,7 @@ class LogCurve { } void set_length (uint32_t len) { l = len; } - mutable Glib::Mutex lock; + mutable Glib::Threads::Mutex lock; protected: float a; diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h index 99513734da..0823a5f8ac 100644 --- a/libs/ardour/ardour/midi_diskstream.h +++ b/libs/ardour/ardour/midi_diskstream.h @@ -199,7 +199,7 @@ class MidiDiskstream : public Diskstream the GUI to read (so that it can update itself). */ MidiBuffer _gui_feed_buffer; - mutable Glib::Mutex _gui_feed_buffer_mutex; + mutable Glib::Threads::Mutex _gui_feed_buffer_mutex; }; }; /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index d0a05e131d..38bd3ab982 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "pbd/command.h" #include "ardour/types.h" #include "ardour/midi_buffer.h" @@ -267,14 +267,14 @@ protected: private: struct WriteLockImpl : public AutomatableSequence::WriteLockImpl { - WriteLockImpl(Glib::Mutex::Lock* source_lock, Glib::RWLock& s, Glib::Mutex& c) + WriteLockImpl(Glib::Threads::Mutex::Lock* slock, Glib::Threads::RWLock& s, Glib::Threads::Mutex& c) : AutomatableSequence::WriteLockImpl(s, c) - , source_lock(source_lock) + , source_lock (slock) {} ~WriteLockImpl() { delete source_lock; } - Glib::Mutex::Lock* source_lock; + Glib::Threads::Mutex::Lock* source_lock; }; public: diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h index 1d4ba56ba3..1a7f3b07c5 100644 --- a/libs/ardour/ardour/midi_source.h +++ b/libs/ardour/ardour/midi_source.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include "pbd/stateful.h" #include "pbd/xml++.h" diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index a64ebdd727..6de772390e 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -230,16 +230,16 @@ public: friend class Session; protected: - class RegionReadLock : public Glib::RWLock::ReaderLock { + class RegionReadLock : public Glib::Threads::RWLock::ReaderLock { public: - RegionReadLock (Playlist *pl) : Glib::RWLock::ReaderLock (pl->region_lock) {} + RegionReadLock (Playlist *pl) : Glib::Threads::RWLock::ReaderLock (pl->region_lock) {} ~RegionReadLock() {} }; - class RegionWriteLock : public Glib::RWLock::WriterLock { + class RegionWriteLock : public Glib::Threads::RWLock::WriterLock { public: RegionWriteLock (Playlist *pl, bool do_block_notify = true) - : Glib::RWLock::WriterLock (pl->region_lock) + : Glib::Threads::RWLock::WriterLock (pl->region_lock) , playlist (pl) , block_notify (do_block_notify) { if (block_notify) { @@ -248,7 +248,7 @@ public: } ~RegionWriteLock() { - Glib::RWLock::WriterLock::release (); + Glib::Threads::RWLock::WriterLock::release (); if (block_notify) { playlist->release_notifications (); } @@ -375,7 +375,7 @@ public: private: friend class RegionReadLock; friend class RegionWriteLock; - mutable Glib::RWLock region_lock; + mutable Glib::Threads::RWLock region_lock; private: void setup_layering_indices (RegionList const &); diff --git a/libs/ardour/ardour/process_thread.h b/libs/ardour/ardour/process_thread.h index 6dd91aa305..871a2584d5 100644 --- a/libs/ardour/ardour/process_thread.h +++ b/libs/ardour/ardour/process_thread.h @@ -1,7 +1,7 @@ #ifndef __libardour_process_thread__ #define __libardour_process_thread__ -#include +#include #include "ardour/chan_count.h" #include "ardour/types.h" @@ -36,7 +36,7 @@ protected: void session_going_away (); private: - static Glib::Private* _private_thread_buffers; + static Glib::Threads::Private _private_thread_buffers; }; } // namespace diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index 471f172440..ed0c962d87 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include "pbd/id.h" #include "pbd/property_list.h" @@ -124,11 +124,11 @@ public: static void region_changed (PBD::PropertyChange const &, boost::weak_ptr); - static Glib::StaticMutex region_map_lock; + static Glib::Threads::Mutex region_map_lock; static RegionMap region_map; - static Glib::StaticMutex region_name_maps_mutex; + static Glib::Threads::Mutex region_name_maps_mutex; /** map of partial region names and suffix numbers */ static std::map region_name_number_map; /** map of complete region names with their region ID */ diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 62a694071f..b2e3d1236e 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include "pbd/fastlog.h" #include "pbd/xml++.h" #include "pbd/undo.h" @@ -191,7 +191,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, void flush_processors (); void foreach_processor (boost::function)> method) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { if (boost::dynamic_pointer_cast (*i)) { break; @@ -201,7 +201,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, } boost::shared_ptr nth_processor (uint32_t n) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator i; for (i = _processors.begin(); i != _processors.end() && n; ++i, --n) {} if (i == _processors.end()) { @@ -468,7 +468,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, framecnt_t _roll_delay; ProcessorList _processors; - mutable Glib::RWLock _processor_lock; + mutable Glib::Threads::RWLock _processor_lock; boost::shared_ptr _main_outs; boost::shared_ptr _monitor_send; boost::shared_ptr _intreturn; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 780c68f2b0..5f20df029c 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include "pbd/error.h" #include "pbd/event_loop.h" @@ -1258,7 +1258,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* REGION MANAGEMENT */ - mutable Glib::Mutex region_lock; + mutable Glib::Threads::Mutex region_lock; int load_regions (const XMLNode& node); int load_compounds (const XMLNode& node); @@ -1269,7 +1269,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* SOURCES */ - mutable Glib::Mutex source_lock; + mutable Glib::Threads::Mutex source_lock; public: typedef std::map > SourceMap; @@ -1354,7 +1354,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi could not report free space. */ bool _total_free_4k_blocks_uncertain; - Glib::Mutex space_lock; + Glib::Threads::Mutex space_lock; bool no_questions_about_missing_files; @@ -1397,7 +1397,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi Sample* click_emphasis_data; framecnt_t click_length; framecnt_t click_emphasis_length; - mutable Glib::RWLock click_lock; + mutable Glib::Threads::RWLock click_lock; static const Sample default_click[]; static const framecnt_t default_click_length; @@ -1450,7 +1450,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi int find_all_sources_across_snapshots (std::set& result, bool exclude_this_snapshot); typedef std::set > Controllables; - Glib::Mutex controllables_lock; + Glib::Threads::Mutex controllables_lock; Controllables controllables; boost::shared_ptr _solo_cut_control; diff --git a/libs/ardour/ardour/session_playlist.h b/libs/ardour/ardour/session_playlist.h index 7f5d1e89ce..fa1acc5828 100644 --- a/libs/ardour/ardour/session_playlist.h +++ b/libs/ardour/ardour/session_playlist.h @@ -29,7 +29,7 @@ namespace ARDOUR { template void SessionPlaylists::foreach (T *obj, void (T::*func)(boost::shared_ptr)) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::iterator i = playlists.begin(); i != playlists.end(); i++) { if (!(*i)->hidden()) { (obj->*func) (*i); diff --git a/libs/ardour/ardour/session_playlists.h b/libs/ardour/ardour/session_playlists.h index 5f69ba8001..83dc8ee58c 100644 --- a/libs/ardour/ardour/session_playlists.h +++ b/libs/ardour/ardour/session_playlists.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -78,7 +78,7 @@ private: int load_unused (Session &, const XMLNode&); boost::shared_ptr XMLPlaylistFactory (Session &, const XMLNode&); - mutable Glib::Mutex lock; + mutable Glib::Threads::Mutex lock; typedef std::set > List; List playlists; List unused_playlists; diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h index cfaa13cdc8..19d8614d1b 100644 --- a/libs/ardour/ardour/session_route.h +++ b/libs/ardour/ardour/session_route.h @@ -22,7 +22,7 @@ #include -#include +#include #include "ardour/session.h" #include "ardour/route.h" diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index a487824e51..1602b8bc8e 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -22,7 +22,7 @@ #include -#include +#include #include @@ -262,7 +262,7 @@ class MTC_Slave : public Slave { size_t speed_accumulator_cnt; bool have_first_speed_accumulator; double average_speed; - Glib::Mutex reset_lock; + Glib::Threads::Mutex reset_lock; uint32_t reset_pending; bool reset_position; diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index e65b4cb093..a3b5fd817a 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include "pbd/statefuldestructible.h" @@ -99,7 +99,7 @@ class Source : public SessionObject void set_allow_remove_if_empty (bool yn); - Glib::Mutex& mutex() { return _lock; } + Glib::Threads::Mutex& mutex() { return _lock; } Flag flags() const { return _flags; } virtual void inc_use_count (); @@ -114,8 +114,8 @@ class Source : public SessionObject time_t _timestamp; framepos_t _timeline_position; bool _analysed; - mutable Glib::Mutex _lock; - mutable Glib::Mutex _analysis_lock; + mutable Glib::Threads::Mutex _lock; + mutable Glib::Threads::Mutex _analysis_lock; gint _use_count; /* atomic */ uint32_t _level; /* how deeply nested is this source w.r.t a disk file */ diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h index 5ddf1f8735..387a40aff3 100644 --- a/libs/ardour/ardour/source_factory.h +++ b/libs/ardour/ardour/source_factory.h @@ -24,6 +24,8 @@ #include #include +#include + #include "ardour/source.h" class XMLNode; @@ -59,8 +61,8 @@ class SourceFactory { (DataType type, Session& s, boost::shared_ptr p, const PBD::ID& orig, const std::string& name, uint32_t chn, frameoffset_t start, framecnt_t len, bool copy, bool defer_peaks); - static Glib::Cond* PeaksToBuild; - static Glib::StaticMutex peak_building_lock; + static Glib::Threads::Cond PeaksToBuild; + static Glib::Threads::Mutex peak_building_lock; static std::list< boost::weak_ptr > files_with_peaks; static int setup_peakfile (boost::shared_ptr, bool async); diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 15032b8741..8e4f1bc420 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "pbd/undo.h" #include "pbd/stateful.h" @@ -218,7 +218,7 @@ class TempoMap : public PBD::StatefulDestructible typedef std::vector BBTPointList; template void apply_with_metrics (T& obj, void (T::*method)(const Metrics&)) { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); (obj.*method)(metrics); } @@ -314,7 +314,7 @@ class TempoMap : public PBD::StatefulDestructible Metrics metrics; framecnt_t _frame_rate; - mutable Glib::RWLock lock; + mutable Glib::Threads::RWLock lock; BBTPointList _map; void recompute_map (bool reassign_tempo_bbt, framepos_t end = -1); diff --git a/libs/ardour/ardour/thread_buffers.h b/libs/ardour/ardour/thread_buffers.h index be8cb42282..9011e98e43 100644 --- a/libs/ardour/ardour/thread_buffers.h +++ b/libs/ardour/ardour/thread_buffers.h @@ -1,7 +1,7 @@ #ifndef __libardour_thread_buffers__ #define __libardour_thread_buffers__ -#include +#include #include "ardour/chan_count.h" #include "ardour/types.h" diff --git a/libs/ardour/ardour/user_bundle.h b/libs/ardour/ardour/user_bundle.h index c124e2e722..5ecfe521f5 100644 --- a/libs/ardour/ardour/user_bundle.h +++ b/libs/ardour/ardour/user_bundle.h @@ -21,7 +21,7 @@ #define __ardour_user_bundle_h__ #include -#include +#include #include "pbd/stateful.h" #include "ardour/bundle.h" diff --git a/libs/ardour/ardour/worker.h b/libs/ardour/ardour/worker.h index 984e375c80..fe278b9618 100644 --- a/libs/ardour/ardour/worker.h +++ b/libs/ardour/ardour/worker.h @@ -22,7 +22,7 @@ #include -#include +#include #include "pbd/ringbuffer.h" #include "pbd/semaphore.h" @@ -76,13 +76,13 @@ public: private: void run(); - Workee* _workee; - Glib::Thread* _thread; - RingBuffer* _requests; - RingBuffer* _responses; - uint8_t* _response; - PBD::Semaphore _sem; - bool _exit; + Workee* _workee; + Glib::Threads::Thread* _thread; + RingBuffer* _requests; + RingBuffer* _responses; + uint8_t* _response; + PBD::Semaphore _sem; + bool _exit; }; } // namespace ARDOUR diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 8e6b5c27f1..3345a00b42 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -151,7 +151,7 @@ void AudioDiskstream::non_realtime_input_change () { { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); if (input_change_pending.type == IOChange::NoChange) { return; @@ -430,7 +430,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecn return 0; } - Glib::Mutex::Lock sm (state_lock, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock sm (state_lock, Glib::Threads::TRY_LOCK); if (!sm.locked()) { return 1; @@ -812,7 +812,7 @@ AudioDiskstream::seek (framepos_t frame, bool complete_refill) ChannelList::iterator chan; boost::shared_ptr c = channels.reader(); - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) { (*chan)->playback_buf->reset (); @@ -1379,7 +1379,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo } /* XXX is there anything we can do if err != 0 ? */ - Glib::Mutex::Lock lm (capture_info_lock); + Glib::Threads::Mutex::Lock lm (capture_info_lock); if (capture_info.empty()) { return; diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc index ea09d20056..915aee9595 100644 --- a/libs/ardour/audio_playlist_source.cc +++ b/libs/ardour/audio_playlist_source.cc @@ -151,7 +151,7 @@ AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cn with any changes to the list of buffers caused by creating new nested playlists/sources */ - Glib::Mutex::Lock lm (_level_buffer_lock); + Glib::Threads::Mutex::Lock lm (_level_buffer_lock); sbuf = _mixdown_buffers[_level-1]; gbuf = _gain_buffers[_level-1]; } diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 4079cdb481..2801a4e997 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -310,7 +310,7 @@ AudioTrack::set_state_part_two () int AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return 0; @@ -483,7 +483,7 @@ AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nfram boost::scoped_array mix_buffer (new Sample[nframes]); boost::shared_ptr diskstream = audio_diskstream(); - Glib::RWLock::ReaderLock rlock (_processor_lock); + Glib::Threads::RWLock::ReaderLock rlock (_processor_lock); boost::shared_ptr apl = boost::dynamic_pointer_cast(diskstream->playlist()); @@ -557,7 +557,7 @@ AudioTrack::bounceable (boost::shared_ptr endpoint, bool include_endp return true; } - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); uint32_t naudio = n_inputs().n_audio(); for (ProcessorList::const_iterator r = _processors.begin(); r != _processors.end(); ++r) { @@ -666,7 +666,7 @@ AudioTrack::freeze_me (InterThreadInfo& itt) _freeze_record.processor_info.clear (); { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) { @@ -729,7 +729,7 @@ AudioTrack::unfreeze () audio_diskstream()->use_playlist (_freeze_record.playlist); { - Glib::RWLock::ReaderLock lm (_processor_lock); // should this be a write lock? jlc + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); // should this be a write lock? jlc for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { for (vector::iterator ii = _freeze_record.processor_info.begin(); ii != _freeze_record.processor_info.end(); ++ii) { if ((*ii)->id == (*i)->id()) { diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index f7f3587e7d..89aa99bac8 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -31,7 +31,7 @@ #include "pbd/pathscanner.h" #include "pbd/locale_guard.h" -#include +#include #include #include diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 004ba33a6e..450bf2a296 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -94,7 +94,7 @@ AudioEngine::AudioEngine (string client_name, string session_uuid) AudioEngine::~AudioEngine () { { - Glib::Mutex::Lock tm (_process_lock); + Glib::Threads::Mutex::Lock tm (_process_lock); session_removed.signal (); if (_running) { @@ -453,7 +453,7 @@ int AudioEngine::process_callback (pframes_t nframes) { GET_PRIVATE_JACK_POINTER_RET(_jack,0); - Glib::Mutex::Lock tm (_process_lock, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock tm (_process_lock, Glib::Threads::TRY_LOCK); PT_TIMING_REF; PT_TIMING_CHECK (1); @@ -714,7 +714,7 @@ AudioEngine::jack_bufsize_callback (pframes_t nframes) } { - Glib::Mutex::Lock lm (_process_lock); + Glib::Threads::Mutex::Lock lm (_process_lock); boost::shared_ptr p = ports.reader(); @@ -745,8 +745,7 @@ AudioEngine::start_metering_thread () { if (m_meter_thread == 0) { g_atomic_int_set (&m_meter_exit, 0); - m_meter_thread = Glib::Thread::create (boost::bind (&AudioEngine::meter_thread, this), - 500000, true, true, Glib::THREAD_PRIORITY_NORMAL); + m_meter_thread = Glib::Threads::Thread::create (boost::bind (&AudioEngine::meter_thread, this)); } } @@ -767,7 +766,7 @@ AudioEngine::meter_thread () void AudioEngine::set_session (Session *s) { - Glib::Mutex::Lock pl (_process_lock); + Glib::Threads::Mutex::Lock pl (_process_lock); SessionHandlePtr::set_session (s); @@ -805,7 +804,7 @@ AudioEngine::set_session (Session *s) void AudioEngine::remove_session () { - Glib::Mutex::Lock lm (_process_lock); + Glib::Threads::Mutex::Lock lm (_process_lock); if (_running) { @@ -1391,7 +1390,7 @@ AudioEngine::disconnect_from_jack () } { - Glib::Mutex::Lock lm (_process_lock); + Glib::Threads::Mutex::Lock lm (_process_lock); jack_client_close (_priv_jack); _jack = 0; } diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index e101f5b25b..2486d45ca1 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -42,7 +42,7 @@ #include #include -#include +#include #include "ardour/audiofilesource.h" #include "ardour/debug.h" @@ -86,7 +86,7 @@ struct SizedSampleBuffer { } }; -Glib::StaticPrivate thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT; +Glib::Threads::Private thread_interleave_buffer; /** Constructor used for existing external-to-session files. */ AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags) diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 41b3ceedc9..577f12c78e 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -26,7 +26,7 @@ #include -#include +#include #include "pbd/basename.h" #include "pbd/xml++.h" diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index e33a3d30de..4deb053cd8 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -46,7 +46,7 @@ using namespace std; using namespace ARDOUR; using namespace PBD; -Glib::StaticMutex AudioSource::_level_buffer_lock = GLIBMM_STATIC_MUTEX_INIT; +Glib::Threads::Mutex AudioSource::_level_buffer_lock; vector > AudioSource::_mixdown_buffers; vector > AudioSource::_gain_buffers; size_t AudioSource::_working_buffers_size = 0; @@ -160,7 +160,7 @@ bool AudioSource::peaks_ready (boost::function doThisWhenReady, ScopedConnection** connect_here_if_not, EventLoop* event_loop) const { bool ret; - Glib::Mutex::Lock lm (_peaks_ready_lock); + Glib::Threads::Mutex::Lock lm (_peaks_ready_lock); if (!(ret = _peaks_built)) { *connect_here_if_not = new ScopedConnection; @@ -281,14 +281,14 @@ AudioSource::read (Sample *dst, framepos_t start, framecnt_t cnt, int /*channel* { assert (cnt >= 0); - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); return read_unlocked (dst, start, cnt); } framecnt_t AudioSource::write (Sample *dst, framecnt_t cnt) { - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); /* any write makes the fill not removable */ _flags = Flag (_flags & ~Removable); return write_unlocked (dst, cnt); @@ -308,7 +308,7 @@ int AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t start, framecnt_t cnt, double samples_per_visual_peak, framecnt_t samples_per_file_peak) const { - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); double scale; double expected_peaks; PeakData::PeakDatum xmax; @@ -646,7 +646,7 @@ AudioSource::build_peaks_from_scratch () { /* hold lock while building peaks */ - Glib::Mutex::Lock lp (_lock); + Glib::Threads::Mutex::Lock lp (_lock); if (prepare_for_peakfile_writes ()) { goto out; @@ -717,7 +717,7 @@ AudioSource::done_with_peakfile_writes (bool done) } if (done) { - Glib::Mutex::Lock lm (_peaks_ready_lock); + Glib::Threads::Mutex::Lock lm (_peaks_ready_lock); _peaks_built = true; PeaksReady (); /* EMIT SIGNAL */ } @@ -777,7 +777,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, framecnt_t first_frame, frame _peak_byte_max = max (_peak_byte_max, (off_t) (byte + sizeof(PeakData))); { - Glib::Mutex::Lock lm (_peaks_ready_lock); + Glib::Threads::Mutex::Lock lm (_peaks_ready_lock); PeakRangeReady (peak_leftover_frame, peak_leftover_cnt); /* EMIT SIGNAL */ if (intermediate_peaks_ready) { PeaksReady (); /* EMIT SIGNAL */ @@ -890,7 +890,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, framecnt_t first_frame, frame _peak_byte_max = max (_peak_byte_max, (off_t) (first_peak_byte + sizeof(PeakData)*peaks_computed)); if (frames_done) { - Glib::Mutex::Lock lm (_peaks_ready_lock); + Glib::Threads::Mutex::Lock lm (_peaks_ready_lock); PeakRangeReady (first_frame, frames_done); /* EMIT SIGNAL */ if (intermediate_peaks_ready) { PeaksReady (); /* EMIT SIGNAL */ @@ -948,7 +948,7 @@ AudioSource::available_peaks (double zoom_factor) const void AudioSource::mark_streaming_write_completed () { - Glib::Mutex::Lock lm (_peaks_ready_lock); + Glib::Threads::Mutex::Lock lm (_peaks_ready_lock); if (_peaks_built) { PeaksReady (); /* EMIT SIGNAL */ @@ -958,7 +958,7 @@ AudioSource::mark_streaming_write_completed () void AudioSource::allocate_working_buffers (framecnt_t framerate) { - Glib::Mutex::Lock lm (_level_buffer_lock); + Glib::Threads::Mutex::Lock lm (_level_buffer_lock); /* Note: we don't need any buffers allocated until @@ -975,7 +975,7 @@ AudioSource::allocate_working_buffers (framecnt_t framerate) void AudioSource::ensure_buffers_for_level (uint32_t level, framecnt_t frame_rate) { - Glib::Mutex::Lock lm (_level_buffer_lock); + Glib::Threads::Mutex::Lock lm (_level_buffer_lock); ensure_buffers_for_level_locked (level, frame_rate); } diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index 6c143568c4..ad4d8b5d16 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -17,7 +17,7 @@ */ -#include +#include #include "pbd/error.h" @@ -136,7 +136,7 @@ Auditioner::audition_region (boost::shared_ptr region) return; } - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); /* copy it */ @@ -154,7 +154,7 @@ Auditioner::audition_region (boost::shared_ptr region) ProcessorStreams ps; { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors (&ps)) { error << string_compose (_("Cannot setup auditioner processing flow for %1 channels"), diff --git a/libs/ardour/auto_bundle.cc b/libs/ardour/auto_bundle.cc index bedb270dc5..366d32b979 100644 --- a/libs/ardour/auto_bundle.cc +++ b/libs/ardour/auto_bundle.cc @@ -16,7 +16,7 @@ ARDOUR::AutoBundle::AutoBundle (std::string const & n, bool i) ARDOUR::ChanCount ARDOUR::AutoBundle::nchannels () const { - Glib::Mutex::Lock lm (_ports_mutex); + Glib::Threads::Mutex::Lock lm (_ports_mutex); return ChanCount (type(), _ports.size ()); } @@ -25,14 +25,14 @@ ARDOUR::AutoBundle::channel_ports (uint32_t c) const { assert (c < nchannels().get (type())); - Glib::Mutex::Lock lm (_ports_mutex); + Glib::Threads::Mutex::Lock lm (_ports_mutex); return _ports[c]; } void ARDOUR::AutoBundle::set_channels (uint32_t n) { - Glib::Mutex::Lock lm (_ports_mutex); + Glib::Threads::Mutex::Lock lm (_ports_mutex); _ports.resize (n); } @@ -41,7 +41,7 @@ ARDOUR::AutoBundle::set_port (uint32_t c, std::string const & p) { assert (c < nchannels ().get (type())); - Glib::Mutex::Lock lm (_ports_mutex); + Glib::Threads::Mutex::Lock lm (_ports_mutex); _ports[c].resize (1); _ports[c][0] = p; } diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 608ae745de..0f6fbdbe17 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -54,7 +54,7 @@ Automatable::Automatable (const Automatable& other) : ControlSet (other) , _a_session (other._a_session) { - Glib::Mutex::Lock lm (other._control_lock); + Glib::Threads::Mutex::Lock lm (other._control_lock); for (Controls::const_iterator i = other._controls.begin(); i != other._controls.end(); ++i) { boost::shared_ptr ac (control_factory (i->first)); @@ -65,7 +65,7 @@ Automatable::Automatable (const Automatable& other) Automatable::~Automatable () { { - Glib::Mutex::Lock lm (_control_lock); + Glib::Threads::Mutex::Lock lm (_control_lock); for (Controls::const_iterator li = _controls.begin(); li != _controls.end(); ++li) { boost::dynamic_pointer_cast(li->second)->drop_references (); @@ -106,7 +106,7 @@ Automatable::load_automation (const string& path) return 1; } - Glib::Mutex::Lock lm (control_lock()); + Glib::Threads::Mutex::Lock lm (control_lock()); set tosave; controls().clear (); @@ -186,7 +186,7 @@ Automatable::can_automate (Evoral::Parameter what) int Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter legacy_param) { - Glib::Mutex::Lock lm (control_lock()); + Glib::Threads::Mutex::Lock lm (control_lock()); /* Don't clear controls, since some may be special derived Controllable classes */ @@ -240,7 +240,7 @@ Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter le XMLNode& Automatable::get_automation_xml_state () { - Glib::Mutex::Lock lm (control_lock()); + Glib::Threads::Mutex::Lock lm (control_lock()); XMLNode* node = new XMLNode (Automatable::xml_node_name); if (controls().empty()) { @@ -260,7 +260,7 @@ Automatable::get_automation_xml_state () void Automatable::set_parameter_automation_state (Evoral::Parameter param, AutoState s) { - Glib::Mutex::Lock lm (control_lock()); + Glib::Threads::Mutex::Lock lm (control_lock()); boost::shared_ptr c = automation_control (param, true); @@ -287,7 +287,7 @@ Automatable::get_parameter_automation_state (Evoral::Parameter param) void Automatable::set_parameter_automation_style (Evoral::Parameter param, AutoStyle s) { - Glib::Mutex::Lock lm (control_lock()); + Glib::Threads::Mutex::Lock lm (control_lock()); boost::shared_ptr c = automation_control(param, true); @@ -300,7 +300,7 @@ Automatable::set_parameter_automation_style (Evoral::Parameter param, AutoStyle AutoStyle Automatable::get_parameter_automation_style (Evoral::Parameter param) { - Glib::Mutex::Lock lm (control_lock()); + Glib::Threads::Mutex::Lock lm (control_lock()); boost::shared_ptr c = control(param); boost::shared_ptr l = boost::dynamic_pointer_cast(c->list()); diff --git a/libs/ardour/automation_watch.cc b/libs/ardour/automation_watch.cc index 5fefcaca8d..d3138ee336 100644 --- a/libs/ardour/automation_watch.cc +++ b/libs/ardour/automation_watch.cc @@ -57,14 +57,14 @@ AutomationWatch::~AutomationWatch () _thread = 0; } - Glib::Mutex::Lock lm (automation_watch_lock); + Glib::Threads::Mutex::Lock lm (automation_watch_lock); automation_watches.clear (); } void AutomationWatch::add_automation_watch (boost::shared_ptr ac) { - Glib::Mutex::Lock lm (automation_watch_lock); + Glib::Threads::Mutex::Lock lm (automation_watch_lock); DEBUG_TRACE (DEBUG::Automation, string_compose ("now watching control %1 for automation\n", ac->name())); automation_watches.push_back (ac); @@ -102,7 +102,7 @@ AutomationWatch::remove_weak_automation_watch (boost::weak_ptr ac) { - Glib::Mutex::Lock lm (automation_watch_lock); + Glib::Threads::Mutex::Lock lm (automation_watch_lock); DEBUG_TRACE (DEBUG::Automation, string_compose ("remove control %1 from automation watch\n", ac->name())); automation_watches.remove (ac); ac->list()->set_in_write_pass (false); @@ -116,7 +116,7 @@ AutomationWatch::timer () } { - Glib::Mutex::Lock lm (automation_watch_lock); + Glib::Threads::Mutex::Lock lm (automation_watch_lock); framepos_t time = _session->audible_frame (); @@ -154,8 +154,7 @@ AutomationWatch::set_session (Session* s) if (_session) { _run_thread = true; - _thread = Glib::Thread::create (boost::bind (&AutomationWatch::thread, this), - 500000, true, true, Glib::THREAD_PRIORITY_NORMAL); + _thread = Glib::Threads::Thread::create (boost::bind (&AutomationWatch::thread, this)); _session->TransportStateChange.connect_same_thread (transport_connection, boost::bind (&AutomationWatch::transport_state_change, this)); } @@ -171,7 +170,7 @@ AutomationWatch::transport_state_change () bool rolling = _session->transport_rolling(); { - Glib::Mutex::Lock lm (automation_watch_lock); + Glib::Threads::Mutex::Lock lm (automation_watch_lock); for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) { DEBUG_TRACE (DEBUG::Automation, string_compose ("%1: transport state changed, speed %2, in write pass ? %3 writing ? %4\n", diff --git a/libs/ardour/buffer_manager.cc b/libs/ardour/buffer_manager.cc index 71ff4946f3..c8819e41cb 100644 --- a/libs/ardour/buffer_manager.cc +++ b/libs/ardour/buffer_manager.cc @@ -29,7 +29,7 @@ using namespace PBD; RingBufferNPT* BufferManager::thread_buffers = 0; std::list* BufferManager::thread_buffers_list = 0; -Glib::StaticMutex BufferManager::rb_mutex = GLIBMM_STATIC_MUTEX_INIT; +Glib::Threads::Mutex BufferManager::rb_mutex; using std::cerr; using std::endl; @@ -55,7 +55,7 @@ BufferManager::init (uint32_t size) ThreadBuffers* BufferManager::get_thread_buffers () { - Glib::Mutex::Lock em (rb_mutex); + Glib::Threads::Mutex::Lock em (rb_mutex); ThreadBuffers* tbp; if (thread_buffers->read (&tbp, 1) == 1) { @@ -69,7 +69,7 @@ BufferManager::get_thread_buffers () void BufferManager::put_thread_buffers (ThreadBuffers* tbp) { - Glib::Mutex::Lock em (rb_mutex); + Glib::Threads::Mutex::Lock em (rb_mutex); thread_buffers->write (&tbp, 1); // cerr << "Put back thread buffers, readable count now " << thread_buffers->read_space() << endl; } diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc index 5040882b7a..f38fe0c42f 100644 --- a/libs/ardour/bundle.cc +++ b/libs/ardour/bundle.cc @@ -67,7 +67,7 @@ Bundle::Bundle (boost::shared_ptr other) ChanCount Bundle::nchannels () const { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); ChanCount c; for (vector::const_iterator i = _channel.begin(); i != _channel.end(); ++i) { @@ -82,7 +82,7 @@ Bundle::channel_ports (uint32_t c) const { assert (c < nchannels().n_total()); - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); return _channel[c].ports; } @@ -97,7 +97,7 @@ Bundle::add_port_to_channel (uint32_t ch, string portname) assert (portname.find_first_of (':') != string::npos); { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel[ch].ports.push_back (portname); } @@ -116,7 +116,7 @@ Bundle::remove_port_from_channel (uint32_t ch, string portname) bool changed = false; { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); PortList& pl = _channel[ch].ports; PortList::iterator i = find (pl.begin(), pl.end(), portname); @@ -142,7 +142,7 @@ Bundle::set_port (uint32_t ch, string portname) assert (portname.find_first_of (':') != string::npos); { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel[ch].ports.clear (); _channel[ch].ports.push_back (portname); } @@ -155,7 +155,7 @@ void Bundle::add_channel (std::string const & n, DataType t) { { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel.push_back (Channel (n, t)); } @@ -167,7 +167,7 @@ void Bundle::add_channel (std::string const & n, DataType t, PortList p) { { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel.push_back (Channel (n, t, p)); } @@ -179,7 +179,7 @@ void Bundle::add_channel (std::string const & n, DataType t, std::string const & p) { { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel.push_back (Channel (n, t, p)); } @@ -191,7 +191,7 @@ Bundle::port_attached_to_channel (uint32_t ch, std::string portname) { assert (ch < nchannels().n_total()); - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); return (std::find (_channel[ch].ports.begin (), _channel[ch].ports.end (), portname) != _channel[ch].ports.end ()); } @@ -203,7 +203,7 @@ Bundle::remove_channel (uint32_t ch) { assert (ch < nchannels().n_total()); - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel.erase (_channel.begin () + ch); } @@ -211,7 +211,7 @@ Bundle::remove_channel (uint32_t ch) void Bundle::remove_channels () { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel.clear (); } @@ -222,7 +222,7 @@ Bundle::remove_channels () bool Bundle::offers_port (std::string p) const { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); for (std::vector::const_iterator i = _channel.begin(); i != _channel.end(); ++i) { for (PortList::const_iterator j = i->ports.begin(); j != i->ports.end(); ++j) { @@ -241,7 +241,7 @@ Bundle::offers_port (std::string p) const bool Bundle::offers_port_alone (std::string p) const { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); for (std::vector::const_iterator i = _channel.begin(); i != _channel.end(); ++i) { if (i->ports.size() == 1 && i->ports[0] == p) { @@ -261,7 +261,7 @@ Bundle::channel_name (uint32_t ch) const { assert (ch < nchannels().n_total()); - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); return _channel[ch].name; } @@ -275,7 +275,7 @@ Bundle::set_channel_name (uint32_t ch, std::string const & n) assert (ch < nchannels().n_total()); { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel[ch].name = n; } @@ -351,7 +351,7 @@ void Bundle::remove_ports_from_channels () { { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); for (uint32_t c = 0; c < _channel.size(); ++c) { _channel[c].ports.clear (); } @@ -370,7 +370,7 @@ Bundle::remove_ports_from_channel (uint32_t ch) assert (ch < nchannels().n_total()); { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); _channel[ch].ports.clear (); } @@ -517,7 +517,7 @@ Bundle::channel_type (uint32_t c) const { assert (c < nchannels().n_total()); - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); return _channel[c].type; } @@ -564,7 +564,7 @@ Bundle::type_channel_to_overall (DataType t, uint32_t c) const return c; } - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); vector::const_iterator i = _channel.begin (); @@ -598,7 +598,7 @@ Bundle::overall_channel_to_type (DataType t, uint32_t c) const return c; } - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); uint32_t s = 0; diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 3e9c7b0d96..db1b316368 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -311,7 +311,7 @@ restart: { - Glib::Mutex::Lock lm (request_lock); + Glib::Threads::Mutex::Lock lm (request_lock); if (should_run && (disk_work_outstanding || transport_work_requested())) { // for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) { @@ -349,7 +349,7 @@ Butler::summon () void Butler::stop () { - Glib::Mutex::Lock lm (request_lock); + Glib::Threads::Mutex::Lock lm (request_lock); char c = Request::Pause; (void) ::write (request_pipe[1], &c, 1); paused.wait(request_lock); @@ -358,7 +358,7 @@ Butler::stop () void Butler::wait_until_finished () { - Glib::Mutex::Lock lm (request_lock); + Glib::Threads::Mutex::Lock lm (request_lock); char c = Request::Pause; (void) ::write (request_pipe[1], &c, 1); paused.wait(request_lock); diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 509f883aed..8611447a93 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -46,7 +46,7 @@ ControlProtocolManager::ControlProtocolManager () ControlProtocolManager::~ControlProtocolManager() { - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); for (list::iterator i = control_protocols.begin(); i != control_protocols.end(); ++i) { delete (*i); @@ -68,7 +68,7 @@ ControlProtocolManager::set_session (Session* s) SessionHandlePtr::set_session (s); if (_session) { - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); for (list::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) { if ((*i)->requested || (*i)->mandatory) { @@ -97,7 +97,7 @@ ControlProtocolManager::session_going_away() SessionHandlePtr::session_going_away (); { - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); for (list::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) { delete *p; @@ -160,7 +160,7 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi) cpi.descriptor->destroy (cpi.descriptor, cpi.protocol); { - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); list::iterator p = find (control_protocols.begin(), control_protocols.end(), cpi.protocol); if (p != control_protocols.end()) { control_protocols.erase (p); @@ -183,7 +183,7 @@ ControlProtocolManager::load_mandatory_protocols () return; } - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); for (list::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) { if ((*i)->mandatory && ((*i)->protocol == 0)) { @@ -319,7 +319,7 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/) XMLNodeConstIterator citer; XMLProperty* prop; - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); clist = node.children(); @@ -357,7 +357,7 @@ XMLNode& ControlProtocolManager::get_state () { XMLNode* root = new XMLNode (state_node_name); - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); for (list::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) { @@ -426,7 +426,7 @@ ControlProtocolManager::instance () void ControlProtocolManager::midi_connectivity_established () { - Glib::Mutex::Lock lm (protocols_lock); + Glib::Threads::Mutex::Lock lm (protocols_lock); for (list::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) { (*p)->midi_connectivity_established (); diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 7a0b0a81b1..553e29244f 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -31,7 +31,7 @@ #include #include -#include +#include #include "pbd/error.h" #include "pbd/basename.h" @@ -171,7 +171,7 @@ Diskstream::set_track (Track* t) void Diskstream::handle_input_change (IOChange change, void * /*src*/) { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); if (change.type & (IOChange::ConfigurationChanged|IOChange::ConnectionsChanged)) { @@ -193,7 +193,7 @@ Diskstream::non_realtime_set_speed () { if (_buffer_reallocation_required) { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); allocate_temporary_buffers (); _buffer_reallocation_required = false; @@ -315,7 +315,7 @@ Diskstream::set_loop (Location *location) ARDOUR::framepos_t Diskstream::get_capture_start_frame (uint32_t n) const { - Glib::Mutex::Lock lm (capture_info_lock); + Glib::Threads::Mutex::Lock lm (capture_info_lock); if (capture_info.size() > n) { /* this is a completed capture */ @@ -329,7 +329,7 @@ Diskstream::get_capture_start_frame (uint32_t n) const ARDOUR::framecnt_t Diskstream::get_captured_frames (uint32_t n) const { - Glib::Mutex::Lock lm (capture_info_lock); + Glib::Threads::Mutex::Lock lm (capture_info_lock); if (capture_info.size() > n) { /* this is a completed capture */ @@ -356,7 +356,7 @@ Diskstream::use_playlist (boost::shared_ptr playlist) bool prior_playlist = false; { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); if (playlist == _playlist) { return 0; diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index 3017615948..cd39faa08e 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -36,7 +36,7 @@ #include #include -#include +#include #include "ardour/data_type.h" #include "ardour/file_source.h" @@ -519,7 +519,7 @@ out: int FileSource::set_source_name (const string& newname, bool destructive) { - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); string oldpath = _path; string newpath = _session.change_source_path_by_name (oldpath, _name, newname, destructive); diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index 300271c21a..d2fbdbf552 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -101,7 +101,7 @@ Graph::reset_thread_list () return; } - Glib::Mutex::Lock lm (_session.engine().process_lock()); + Glib::Threads::Mutex::Lock lm (_session.engine().process_lock()); pthread_t a_thread; if (!_thread_list.empty()) { @@ -162,7 +162,7 @@ Graph::drop_threads () void Graph::clear_other_chain () { - Glib::Mutex::Lock ls (_swap_mutex); + Glib::Threads::Mutex::Lock ls (_swap_mutex); while (1) { if (_setup_chain != _pending_chain) { @@ -275,7 +275,7 @@ Graph::restart_cycle() void Graph::rechain (boost::shared_ptr routelist, GraphEdges const & edges) { - Glib::Mutex::Lock ls (_swap_mutex); + Glib::Threads::Mutex::Lock ls (_swap_mutex); int chain = _setup_chain; DEBUG_TRACE (DEBUG::Graph, string_compose ("============== setup %1\n", chain)); diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc index ad2ed81194..af6b6110b6 100644 --- a/libs/ardour/internal_return.cc +++ b/libs/ardour/internal_return.cc @@ -16,7 +16,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #include "ardour/internal_return.h" #include "ardour/internal_send.h" @@ -37,7 +37,7 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e return; } - Glib::Mutex::Lock lm (_sends_mutex, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock lm (_sends_mutex, Glib::Threads::TRY_LOCK); if (lm.locked ()) { for (list::iterator i = _sends.begin(); i != _sends.end(); ++i) { @@ -53,14 +53,14 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e void InternalReturn::add_send (InternalSend* send) { - Glib::Mutex::Lock lm (_sends_mutex); + Glib::Threads::Mutex::Lock lm (_sends_mutex); _sends.push_back (send); } void InternalReturn::remove_send (InternalSend* send) { - Glib::Mutex::Lock lm (_sends_mutex); + Glib::Threads::Mutex::Lock lm (_sends_mutex); _sends.remove (send); } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 01a4a64a38..d39ba7b4f9 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include "pbd/xml++.h" #include "pbd/replace_all.h" @@ -44,7 +44,7 @@ #include "i18n.h" -#define BLOCK_PROCESS_CALLBACK() Glib::Mutex::Lock em (AudioEngine::instance()->process_lock()) +#define BLOCK_PROCESS_CALLBACK() Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock()) using namespace std; using namespace ARDOUR; @@ -86,7 +86,7 @@ IO::IO (Session& s, const XMLNode& node, DataType dt, bool sendish) IO::~IO () { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); BLOCK_PROCESS_CALLBACK (); @@ -104,7 +104,7 @@ IO::disconnect_check (boost::shared_ptr a, boost::shared_ptr b) we assume that its safely locked by our own ::disconnect(). */ - Glib::Mutex::Lock tm (io_lock, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock tm (io_lock, Glib::Threads::TRY_LOCK); if (tm.locked()) { /* we took the lock, so we cannot be here from inside @@ -194,7 +194,7 @@ IO::disconnect (boost::shared_ptr our_port, string other_port, void* src) } { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); /* check that our_port is really one of ours */ @@ -227,7 +227,7 @@ IO::connect (boost::shared_ptr our_port, string other_port, void* src) } { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); /* check that our_port is really one of ours */ @@ -264,7 +264,7 @@ IO::remove_port (boost::shared_ptr port, void* src) BLOCK_PROCESS_CALLBACK (); { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); if (_ports.remove(port)) { change.type = IOChange::Type (change.type | IOChange::ConfigurationChanged); @@ -332,7 +332,7 @@ IO::add_port (string destination, void* src, DataType type) { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); /* Create a new port */ @@ -377,7 +377,7 @@ int IO::disconnect (void* src) { { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) { i->disconnect_all (); @@ -479,7 +479,7 @@ IO::ensure_ports (ChanCount count, bool clear, void* src) change.before = _ports.count (); { - Glib::Mutex::Lock im (io_lock); + Glib::Threads::Mutex::Lock im (io_lock); if (ensure_ports_locked (count, clear, changed)) { return -1; } @@ -521,7 +521,7 @@ IO::state (bool /*full_state*/) vector::iterator ci; int n; LocaleGuard lg (X_("POSIX")); - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); node->add_property("name", _name); id().print (buf, sizeof (buf)); @@ -883,7 +883,7 @@ IO::create_ports (const XMLNode& node, int version) get_port_counts (node, version, n, c); { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (ensure_ports (n, true, this)) { error << string_compose(_("%1: cannot create I/O ports"), _name) << endmsg; @@ -1099,7 +1099,7 @@ IO::set_ports (const string& str) } { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); // FIXME: audio-only if (ensure_ports (ChanCount(DataType::AUDIO, nports), true, this)) { @@ -1246,7 +1246,7 @@ IO::connect_ports_to_bundle (boost::shared_ptr c, void* src) BLOCK_PROCESS_CALLBACK (); { - Glib::Mutex::Lock lm2 (io_lock); + Glib::Threads::Mutex::Lock lm2 (io_lock); c->connect (_bundle, _session.engine()); @@ -1278,7 +1278,7 @@ IO::disconnect_ports_from_bundle (boost::shared_ptr c, void* src) BLOCK_PROCESS_CALLBACK (); { - Glib::Mutex::Lock lm2 (io_lock); + Glib::Threads::Mutex::Lock lm2 (io_lock); c->disconnect (_bundle, _session.engine()); @@ -1314,7 +1314,7 @@ IO::disable_connecting () int IO::enable_connecting () { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock()); connecting_legal = true; boost::optional r = ConnectingLegal (); return r.get_value_or (0); @@ -1720,6 +1720,6 @@ IO::physically_connected () const bool IO::has_port (boost::shared_ptr p) const { - Glib::Mutex::Lock lm (io_lock); + Glib::Threads::Mutex::Lock lm (io_lock); return _ports.contains (p); } diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index e909957e0d..96a289e06f 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -573,7 +573,7 @@ Locations::set_current (Location *loc, bool want_lock) int ret; if (want_lock) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); ret = set_current_unlocked (loc); } else { ret = set_current_unlocked (loc); @@ -635,7 +635,7 @@ void Locations::clear () { { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (LocationList::iterator i = locations.begin(); i != locations.end(); ) { @@ -660,7 +660,7 @@ void Locations::clear_markers () { { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); LocationList::iterator tmp; for (LocationList::iterator i = locations.begin(); i != locations.end(); ) { @@ -682,7 +682,7 @@ void Locations::clear_ranges () { { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); LocationList::iterator tmp; for (LocationList::iterator i = locations.begin(); i != locations.end(); ) { @@ -711,7 +711,7 @@ Locations::add (Location *loc, bool make_current) assert (loc); { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); locations.push_back (loc); if (make_current) { @@ -743,7 +743,7 @@ Locations::remove (Location *loc) } { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (i = locations.begin(); i != locations.end(); ++i) { if ((*i) == loc) { @@ -781,7 +781,7 @@ Locations::get_state () { XMLNode *node = new XMLNode ("Locations"); LocationList::iterator iter; - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (iter = locations.begin(); iter != locations.end(); ++iter) { node->add_child_nocopy ((*iter)->get_state ()); @@ -812,7 +812,7 @@ Locations::set_state (const XMLNode& node, int version) } { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); XMLNodeConstIterator niter; for (niter = nlist.begin(); niter != nlist.end(); ++niter) { @@ -910,7 +910,7 @@ Locations::first_location_before (framepos_t frame, bool include_special_ranges) LocationList locs; { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); locs = locations; } @@ -937,7 +937,7 @@ Locations::first_location_after (framepos_t frame, bool include_special_ranges) LocationList locs; { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); locs = locations; } @@ -973,7 +973,7 @@ Locations::marks_either_side (framepos_t const frame, framepos_t& before, framep LocationList locs; { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); locs = locations; } @@ -1067,7 +1067,7 @@ uint32_t Locations::num_range_markers () const { uint32_t cnt = 0; - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) { if ((*i)->is_range_marker()) { ++cnt; @@ -1090,7 +1090,7 @@ Locations::get_location_by_id(PBD::ID id) void Locations::find_all_between (framepos_t start, framepos_t end, LocationList& ll, Location::Flags flags) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) { if ((flags == 0 || (*i)->matches (flags)) && diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 5e2a6e23b9..64f02b0ad9 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -31,7 +31,7 @@ #include "pbd/error.h" #include "pbd/basename.h" -#include +#include #include "pbd/xml++.h" #include "pbd/memento_command.h" #include "pbd/enumwriter.h" @@ -131,7 +131,7 @@ MidiDiskstream::init () MidiDiskstream::~MidiDiskstream () { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); } @@ -149,7 +149,7 @@ void MidiDiskstream::non_realtime_input_change () { { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); if (input_change_pending.type == IOChange::NoChange) { return; @@ -326,7 +326,7 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecnt return 1; } - Glib::Mutex::Lock sm (state_lock, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock sm (state_lock, Glib::Threads::TRY_LOCK); if (!sm.locked()) { return 1; @@ -376,7 +376,7 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecnt } if (buf.size() != 0) { - Glib::Mutex::Lock lm (_gui_feed_buffer_mutex, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex, Glib::Threads::TRY_LOCK); if (lm.locked ()) { /* Copy this data into our GUI feed buffer and tell the GUI @@ -503,7 +503,7 @@ MidiDiskstream::overwrite_existing_buffers () int MidiDiskstream::seek (framepos_t frame, bool complete_refill) { - Glib::Mutex::Lock lm (state_lock); + Glib::Threads::Mutex::Lock lm (state_lock); int ret = -1; if (g_atomic_int_get (&_frames_read_from_ringbuffer) == 0) { @@ -789,7 +789,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen } /* XXX is there anything we can do if err != 0 ? */ - Glib::Mutex::Lock lm (capture_info_lock); + Glib::Threads::Mutex::Lock lm (capture_info_lock); if (capture_info.empty()) { goto no_capture_stuff_to_do; @@ -1330,7 +1330,7 @@ MidiDiskstream::get_gui_feed_buffer () const { boost::shared_ptr b (new MidiBuffer (AudioEngine::instance()->raw_buffer_size (DataType::MIDI))); - Glib::Mutex::Lock lm (_gui_feed_buffer_mutex); + Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex); b->copy (_gui_feed_buffer); return b; } diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index a914a0d887..e86b229c71 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -1555,7 +1555,7 @@ MidiModel::edit_lock() boost::shared_ptr ms = _midi_source.lock (); assert (ms); - Glib::Mutex::Lock* source_lock = new Glib::Mutex::Lock (ms->mutex()); + Glib::Threads::Mutex::Lock* source_lock = new Glib::Threads::Mutex::Lock (ms->mutex()); ms->invalidate(); // Release cached iterator's read lock on model return WriteLock(new WriteLockImpl(source_lock, _lock, _control_lock)); } @@ -1807,7 +1807,7 @@ MidiModel::set_midi_source (boost::shared_ptr s) void MidiModel::source_interpolation_changed (Evoral::Parameter p, Evoral::ControlList::InterpolationStyle s) { - Glib::Mutex::Lock lm (_control_lock); + Glib::Threads::Mutex::Lock lm (_control_lock); control(p)->list()->set_interpolation (s); } @@ -1826,7 +1826,7 @@ MidiModel::control_list_interpolation_changed (Evoral::Parameter p, Evoral::Cont void MidiModel::source_automation_state_changed (Evoral::Parameter p, AutoState s) { - Glib::Mutex::Lock lm (_control_lock); + Glib::Threads::Mutex::Lock lm (_control_lock); boost::shared_ptr al = boost::dynamic_pointer_cast (control(p)->list ()); al->set_automation_state (s); } diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 518413e2de..8509e55f97 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -24,7 +24,7 @@ #include -#include +#include #include "pbd/xml++.h" #include "pbd/basename.h" @@ -407,7 +407,7 @@ MidiRegion::model_automation_state_changed (Evoral::Parameter const & p) for a given set of filtered_parameters, so now that we've changed that list we must invalidate the iterator. */ - Glib::Mutex::Lock lm (midi_source(0)->mutex()); + Glib::Threads::Mutex::Lock lm (midi_source(0)->mutex()); midi_source(0)->invalidate (); } diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index 96e7b2b934..92795db4ae 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -195,7 +195,7 @@ MidiSource::midi_read (Evoral::EventSink& dst, framepos_t source_sta MidiStateTracker* tracker, std::set const & filtered) const { - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); BeatsFramesConverter converter(_session.tempo_map(), source_start); @@ -260,7 +260,7 @@ MidiSource::midi_read (Evoral::EventSink& dst, framepos_t source_sta framecnt_t MidiSource::midi_write (MidiRingBuffer& source, framepos_t source_start, framecnt_t duration) { - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); const framecnt_t ret = write_unlocked (source, source_start, duration); diff --git a/libs/ardour/midi_stretch.cc b/libs/ardour/midi_stretch.cc index aa03def614..1794d5ff93 100644 --- a/libs/ardour/midi_stretch.cc +++ b/libs/ardour/midi_stretch.cc @@ -85,7 +85,7 @@ MidiStretch::run (boost::shared_ptr r, Progress*) boost::shared_ptr new_src = boost::dynamic_pointer_cast(nsrcs[0]); assert(new_src); - Glib::Mutex::Lock sl (new_src->mutex ()); + Glib::Threads::Mutex::Lock sl (new_src->mutex ()); new_src->load_model(false, true); boost::shared_ptr new_model = new_src->model(); diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 800e7949d5..0f73292c67 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -276,7 +276,7 @@ MidiTrack::set_state_part_two () int MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return 0; } @@ -401,7 +401,7 @@ MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr void MidiTrack::realtime_locate () { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked ()) { return; @@ -417,7 +417,7 @@ MidiTrack::realtime_locate () void MidiTrack::realtime_handle_transport_stopped () { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked ()) { return; diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 6c95730f24..1176c59f25 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -482,7 +482,7 @@ MTC_Slave::resolution () const void MTC_Slave::queue_reset (bool reset_pos) { - Glib::Mutex::Lock lm (reset_lock); + Glib::Threads::Mutex::Lock lm (reset_lock); reset_pending++; if (reset_pos) { reset_position = true; @@ -492,7 +492,7 @@ MTC_Slave::queue_reset (bool reset_pos) void MTC_Slave::maybe_reset () { - Glib::Mutex::Lock lm (reset_lock); + Glib::Threads::Mutex::Lock lm (reset_lock); if (reset_pending) { reset (reset_position); diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index f390e190f5..23cebf4276 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -552,7 +552,7 @@ PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes) framepos_t end = now + nframes; framecnt_t offset = 0; - Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock lm (control_lock(), Glib::Threads::TRY_LOCK); if (!lm.locked()) { connect_and_run (bufs, nframes, offset, false); diff --git a/libs/ardour/process_thread.cc b/libs/ardour/process_thread.cc index 5d3b54cb13..e10ccf160c 100644 --- a/libs/ardour/process_thread.cc +++ b/libs/ardour/process_thread.cc @@ -29,20 +29,17 @@ using namespace ARDOUR; using namespace Glib; using namespace std; -Private* ProcessThread::_private_thread_buffers = 0; - static void release_thread_buffer (void* arg) { BufferManager::put_thread_buffers ((ThreadBuffers*) arg); } +Glib::Threads::Private ProcessThread::_private_thread_buffers (release_thread_buffer); + void ProcessThread::init () { - if (_private_thread_buffers == 0) { - _private_thread_buffers = new Private (release_thread_buffer); - } } ProcessThread::ProcessThread () @@ -59,22 +56,22 @@ ProcessThread::get_buffers () ThreadBuffers* tb = BufferManager::get_thread_buffers (); assert (tb); - _private_thread_buffers->set (tb); + _private_thread_buffers.set (tb); } void ProcessThread::drop_buffers () { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); BufferManager::put_thread_buffers (tb); - _private_thread_buffers->set (0); + _private_thread_buffers.set (0); } BufferSet& ProcessThread::get_silent_buffers (ChanCount count) { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); BufferSet* sb = tb->silent_buffers; @@ -95,7 +92,7 @@ ProcessThread::get_silent_buffers (ChanCount count) BufferSet& ProcessThread::get_scratch_buffers (ChanCount count) { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); BufferSet* sb = tb->scratch_buffers; @@ -114,7 +111,7 @@ ProcessThread::get_scratch_buffers (ChanCount count) BufferSet& ProcessThread::get_mix_buffers (ChanCount count) { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); BufferSet* mb = tb->mix_buffers; @@ -128,7 +125,7 @@ ProcessThread::get_mix_buffers (ChanCount count) gain_t* ProcessThread::gain_automation_buffer() { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); gain_t *g = tb->gain_automation_buffer; @@ -139,7 +136,7 @@ ProcessThread::gain_automation_buffer() gain_t* ProcessThread::send_gain_automation_buffer() { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); gain_t* g = tb->send_gain_automation_buffer; @@ -150,7 +147,7 @@ ProcessThread::send_gain_automation_buffer() pan_t** ProcessThread::pan_automation_buffer() { - ThreadBuffers* tb = _private_thread_buffers->get(); + ThreadBuffers* tb = _private_thread_buffers.get(); assert (tb); pan_t** p = tb->pan_automation_buffer; diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 2166741dda..c74ce4e419 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include "pbd/xml++.h" #include "ardour/debug.h" diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index ddc0451523..3e81524750 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -36,10 +36,10 @@ using namespace PBD; using namespace std; PBD::Signal1 > RegionFactory::CheckNewRegion; -Glib::StaticMutex RegionFactory::region_map_lock; +Glib::Threads::Mutex RegionFactory::region_map_lock; RegionFactory::RegionMap RegionFactory::region_map; PBD::ScopedConnectionList* RegionFactory::region_list_connections = 0; -Glib::StaticMutex RegionFactory::region_name_maps_mutex; +Glib::Threads::Mutex RegionFactory::region_name_maps_mutex; std::map RegionFactory::region_name_number_map; std::map RegionFactory::region_name_map; RegionFactory::CompoundAssociations RegionFactory::_compound_associations; @@ -310,7 +310,7 @@ RegionFactory::map_add (boost::shared_ptr r) p.second = r; { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); region_map.insert (p); } @@ -332,7 +332,7 @@ RegionFactory::map_remove (boost::weak_ptr w) return; } - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); RegionMap::iterator i = region_map.find (r->id()); if (i != region_map.end()) { @@ -383,7 +383,7 @@ RegionFactory::clear_map () } { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); region_map.clear (); _compound_associations.clear (); region_name_map.clear (); @@ -397,7 +397,7 @@ RegionFactory::delete_all_regions () /* copy region list */ { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); copy = region_map; } @@ -417,7 +417,7 @@ RegionFactory::delete_all_regions () uint32_t RegionFactory::nregions () { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); return region_map.size (); } @@ -427,7 +427,7 @@ RegionFactory::add_to_region_name_maps (boost::shared_ptr region) { update_region_name_number_map (region); - Glib::Mutex::Lock lm (region_name_maps_mutex); + Glib::Threads::Mutex::Lock lm (region_name_maps_mutex); region_name_map[region->name()] = region->id (); } @@ -437,7 +437,7 @@ RegionFactory::rename_in_region_name_maps (boost::shared_ptr region) { update_region_name_number_map (region); - Glib::Mutex::Lock lm (region_name_maps_mutex); + Glib::Threads::Mutex::Lock lm (region_name_maps_mutex); map::iterator i = region_name_map.begin(); while (i != region_name_map.end() && i->second != region->id ()) { @@ -476,7 +476,7 @@ RegionFactory::update_region_name_number_map (boost::shared_ptr region) which is just fine */ - Glib::Mutex::Lock lm (region_name_maps_mutex); + Glib::Threads::Mutex::Lock lm (region_name_maps_mutex); region_name_number_map[base] = atoi (number.c_str ()); } } @@ -526,7 +526,7 @@ RegionFactory::region_name (string& result, string base, bool newlevel) } { - Glib::Mutex::Lock lm (region_name_maps_mutex); + Glib::Threads::Mutex::Lock lm (region_name_maps_mutex); map::iterator x; @@ -622,7 +622,7 @@ RegionFactory::new_region_name (string old) void RegionFactory::get_regions_using_source (boost::shared_ptr s, std::set >& r) { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); for (RegionMap::iterator i = region_map.begin(); i != region_map.end(); ++i) { if (i->second->uses_source (s)) { @@ -634,7 +634,7 @@ RegionFactory::get_regions_using_source (boost::shared_ptr s, std::set src) { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); RegionMap::iterator i = region_map.begin(); while (i != region_map.end()) { @@ -654,6 +654,6 @@ RegionFactory::remove_regions_using_source (boost::shared_ptr src) void RegionFactory::add_compound_association (boost::shared_ptr orig, boost::shared_ptr copy) { - Glib::Mutex::Lock lm (region_map_lock); + Glib::Threads::Mutex::Lock lm (region_map_lock); _compound_associations[copy] = orig; } diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc index 43a2e1bfd1..519f3ca494 100644 --- a/libs/ardour/return.cc +++ b/libs/ardour/return.cc @@ -151,7 +151,7 @@ Return::configure_io (ChanCount in, ChanCount out) // Ensure there are enough buffers (since we add some) if (_session.get_scratch_buffers(in).count() < out) { - Glib::Mutex::Lock em (_session.engine().process_lock()); + Glib::Threads::Mutex::Lock em (_session.engine().process_lock()); IO::PortCountChanged(out); } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index de4a583291..a540e0aa93 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -168,7 +168,7 @@ Route::init () { /* run a configure so that the invisible processors get set up */ - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); configure_processors (0); } @@ -188,7 +188,7 @@ Route::~Route () be half-destroyed by now */ - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { (*i)->drop_references (); } @@ -885,7 +885,7 @@ dump_processors(const string& name, const list >& p boost::shared_ptr Route::before_processor_for_placement (Placement p) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator loc; @@ -910,7 +910,7 @@ Route::before_processor_for_index (int index) return boost::shared_ptr (); } - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator i = _processors.begin (); int j = 0; @@ -963,7 +963,7 @@ Route::add_processor (boost::shared_ptr processor, boost::shared_ptr< } { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); boost::shared_ptr pi; @@ -1003,7 +1003,7 @@ Route::add_processor (boost::shared_ptr processor, boost::shared_ptr< // configure redirect ports properly, etc. { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors_unlocked (err)) { pstate.restore (); @@ -1132,7 +1132,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr } { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); for (ProcessorList::const_iterator i = others.begin(); i != others.end(); ++i) { @@ -1154,7 +1154,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr } { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors_unlocked (err)) { pstate.restore (); configure_processors_unlocked (0); // it worked before we tried to add it ... @@ -1205,7 +1205,7 @@ Route::placement_range(Placement p, ProcessorList::iterator& start, ProcessorLis void Route::disable_processors (Placement p) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator start, end; placement_range(p, start, end); @@ -1222,7 +1222,7 @@ Route::disable_processors (Placement p) void Route::disable_processors () { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { (*i)->deactivate (); @@ -1237,7 +1237,7 @@ Route::disable_processors () void Route::disable_plugins (Placement p) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator start, end; placement_range(p, start, end); @@ -1256,7 +1256,7 @@ Route::disable_plugins (Placement p) void Route::disable_plugins () { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { if (boost::dynamic_pointer_cast (*i)) { @@ -1271,7 +1271,7 @@ Route::disable_plugins () void Route::ab_plugins (bool forward) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); if (forward) { @@ -1330,7 +1330,7 @@ Route::clear_processors (Placement p) } { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorList new_list; ProcessorStreams err; bool seen_amp = false; @@ -1376,7 +1376,7 @@ Route::clear_processors (Placement p) _processors = new_list; { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); configure_processors_unlocked (&err); // this can't fail } } @@ -1414,7 +1414,7 @@ Route::remove_processor (boost::shared_ptr processor, ProcessorStream processor_max_streams.reset(); { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); ProcessorList::iterator i; @@ -1455,7 +1455,7 @@ Route::remove_processor (boost::shared_ptr processor, ProcessorStream } if (need_process_lock) { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors_unlocked (err)) { pstate.restore (); @@ -1506,7 +1506,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams* processor_max_streams.reset(); { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); ProcessorList::iterator i; @@ -1553,7 +1553,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams* _output->set_user_latency (0); { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors_unlocked (err)) { pstate.restore (); @@ -1604,7 +1604,7 @@ Route::configure_processors (ProcessorStreams* err) assert (!AudioEngine::instance()->process_lock().trylock()); if (!_in_configure_processors) { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); return configure_processors_unlocked (err); } @@ -1620,7 +1620,7 @@ Route::input_streams () const list > Route::try_configure_processors (ChanCount in, ProcessorStreams* err) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); return try_configure_processors_unlocked (in, err); } @@ -1725,7 +1725,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err) void Route::all_visible_processors_active (bool state) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); if (_processors.empty()) { return; @@ -1756,7 +1756,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err */ { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); ProcessorList::iterator oiter; @@ -1818,7 +1818,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err maybe_note_meter_position (); { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors_unlocked (err)) { pstate.restore (); @@ -2125,7 +2125,7 @@ Route::set_state (const XMLNode& node, int version) if ((prop = node.property (X_("processor-after-last-custom-meter"))) != 0) { PBD::ID id (prop->value ()); - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::const_iterator i = _processors.begin (); while (i != _processors.end() && (*i)->id() != id) { ++i; @@ -2559,11 +2559,11 @@ Route::set_processor_state (const XMLNode& node) } { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); _processors = new_order; if (must_configure) { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); configure_processors_unlocked (0); } @@ -2597,7 +2597,7 @@ Route::curve_reallocate () void Route::silence (framecnt_t nframes) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return; } @@ -2643,7 +2643,7 @@ Route::add_internal_return () void Route::add_send_to_internal_return (InternalSend* send) { - Glib::RWLock::ReaderLock rm (_processor_lock); + Glib::Threads::RWLock::ReaderLock rm (_processor_lock); for (ProcessorList::const_iterator x = _processors.begin(); x != _processors.end(); ++x) { boost::shared_ptr d = boost::dynamic_pointer_cast(*x); @@ -2657,7 +2657,7 @@ Route::add_send_to_internal_return (InternalSend* send) void Route::remove_send_from_internal_return (InternalSend* send) { - Glib::RWLock::ReaderLock rm (_processor_lock); + Glib::Threads::RWLock::ReaderLock rm (_processor_lock); for (ProcessorList::const_iterator x = _processors.begin(); x != _processors.end(); ++x) { boost::shared_ptr d = boost::dynamic_pointer_cast(*x); @@ -2697,7 +2697,7 @@ Route::add_aux_send (boost::shared_ptr route, boost::shared_ptr route, boost::shared_ptr listener; { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); listener.reset (new InternalSend (_session, _pannable, _mute_master, route, Delivery::Aux)); } @@ -2735,7 +2735,7 @@ Route::remove_aux_or_listen (boost::shared_ptr route) ProcessorList::iterator tmp; { - Glib::RWLock::ReaderLock rl(_processor_lock); + Glib::Threads::RWLock::ReaderLock rl(_processor_lock); /* have to do this early because otherwise processor reconfig * will put _monitor_send back in the list @@ -2871,7 +2871,7 @@ Route::nonrealtime_handle_transport_stopped (bool /*abort_ignored*/, bool did_lo framepos_t now = _session.transport_frame(); { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); Automatable::transport_stopped (now); @@ -2958,7 +2958,7 @@ Route::pans_required () const int Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return 0; } @@ -2995,7 +2995,7 @@ Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& /* need_butler */) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return 0; } @@ -3036,7 +3036,7 @@ Route::flush_processors () this is called from the RT audio thread. */ - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { (*i)->flush (); @@ -3055,7 +3055,7 @@ Route::set_meter_point (MeterPoint p, bool force) bool meter_was_visible_to_user = _meter->display_to_user (); { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); maybe_note_meter_position (); @@ -3122,11 +3122,11 @@ void Route::listen_position_changed () { { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (configure_processors_unlocked (0)) { pstate.restore (); @@ -3149,7 +3149,7 @@ Route::add_export_point() _capturing_processor->activate (); { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); configure_processors (0); } @@ -3363,7 +3363,7 @@ Route::shift (framepos_t pos, framecnt_t frames) /* redirect automation */ { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin (); i != _processors.end (); ++i) { set parameters = (*i)->what_can_be_automated(); @@ -3463,7 +3463,7 @@ Route::set_name_in_state (XMLNode& node, string const & name) boost::shared_ptr Route::internal_send_for (boost::shared_ptr target) const { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { boost::shared_ptr send; @@ -3547,7 +3547,7 @@ Route::set_active (bool yn, void* src) void Route::meter () { - Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock rm (_processor_lock, Glib::Threads::TRY_LOCK); assert (_meter); @@ -3602,7 +3602,7 @@ Route::get_control (const Evoral::Parameter& param) /* maybe one of our processors does or ... */ - Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock rm (_processor_lock, Glib::Threads::TRY_LOCK); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { if ((c = boost::dynamic_pointer_cast((*i)->control (param))) != 0) { break; @@ -3624,7 +3624,7 @@ Route::get_control (const Evoral::Parameter& param) boost::shared_ptr Route::nth_plugin (uint32_t n) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator i; for (i = _processors.begin(); i != _processors.end(); ++i) { @@ -3641,7 +3641,7 @@ Route::nth_plugin (uint32_t n) boost::shared_ptr Route::nth_send (uint32_t n) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator i; for (i = _processors.begin(); i != _processors.end(); ++i) { @@ -3658,7 +3658,7 @@ Route::nth_send (uint32_t n) bool Route::has_io_processor_named (const string& name) { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); ProcessorList::iterator i; for (i = _processors.begin(); i != _processors.end(); ++i) { @@ -3682,7 +3682,7 @@ Route::mute_points () const void Route::set_processor_positions () { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); bool had_amp = false; for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { @@ -3714,7 +3714,7 @@ Route::unknown_processors () const { list p; - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { if (boost::dynamic_pointer_cast (*i)) { p.push_back ((*i)->name ()); @@ -3839,7 +3839,7 @@ void Route::setup_invisible_processors () { #ifndef NDEBUG - Glib::RWLock::WriterLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::WriterLock lm (_processor_lock, Glib::Threads::TRY_LOCK); assert (!lm.locked ()); #endif @@ -3995,8 +3995,8 @@ Route::setup_invisible_processors () void Route::unpan () { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); - Glib::RWLock::ReaderLock lp (_processor_lock); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::RWLock::ReaderLock lp (_processor_lock); _pannable.reset (); @@ -4040,7 +4040,7 @@ Route::maybe_note_meter_position () boost::shared_ptr Route::processor_by_id (PBD::ID id) const { - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { if ((*i)->id() == id) { return *i; @@ -4088,7 +4088,7 @@ Route::has_external_redirects () const boost::shared_ptr Route::the_instrument () const { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { if (boost::dynamic_pointer_cast(*i)) { if ((*i)->input_streams().n_midi() > 0 && @@ -4108,7 +4108,7 @@ Route::non_realtime_locate (framepos_t pos) } { - Glib::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { (*i)->transport_located (pos); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 59667b2fce..3d7535d5e5 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -560,7 +560,7 @@ Session::when_engine_running () ControlProtocolManager::instance().midi_connectivity_established (); if (_is_new && !no_auto_connect()) { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock()); auto_connect_master_bus (); } @@ -626,7 +626,7 @@ Session::remove_monitor_section () * pieces of audio as we work on each route. */ - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); /* Connect tracks to monitor section. Note that in an existing session, the internal sends will already exist, but we want the @@ -672,7 +672,7 @@ Session::add_monitor_section () // boost_debug_shared_ptr_mark_interesting (r.get(), "Route"); #endif { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); r->input()->ensure_io (_master_out->output()->n_ports(), false, this); r->output()->ensure_io (_master_out->output()->n_ports(), false, this); } @@ -773,7 +773,7 @@ Session::add_monitor_section () * pieces of audio as we work on each route. */ - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); /* Connect tracks to monitor section. Note that in an existing session, the internal sends will already exist, but we want the @@ -1625,7 +1625,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost: // boost_debug_shared_ptr_mark_interesting (track.get(), "Track"); #endif { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (track->input()->ensure_io (input, false, this)) { error << "cannot configure " << input << " out configuration for new midi track" << endmsg; goto failed; @@ -1725,7 +1725,7 @@ Session::auto_connect_route (boost::shared_ptr route, ChanCount& existing return; } - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock (), Glib::NOT_LOCK); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock (), Glib::Threads::NOT_LOCK); if (with_lock) { lm.acquire (); @@ -1860,7 +1860,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod // boost_debug_shared_ptr_mark_interesting (track.get(), "Track"); #endif { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (track->input()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) { error << string_compose ( @@ -1946,7 +1946,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r // boost_debug_shared_ptr_mark_interesting (bus.get(), "Route"); #endif { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); if (bus->input()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) { error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"), @@ -2062,7 +2062,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template loading this normally happens in a different way. */ - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); IOChange change (IOChange::Type (IOChange::ConfigurationChanged | IOChange::ConnectionsChanged)); change.after = route->input()->n_ports(); @@ -2183,7 +2183,7 @@ Session::add_routes (RouteList& new_routes, bool input_auto_connect, bool output if (_monitor_out && IO::connecting_legal) { { - Glib::Mutex::Lock lm (_engine.process_lock()); + Glib::Threads::Mutex::Lock lm (_engine.process_lock()); for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) { if ((*x)->is_monitor()) { @@ -2854,7 +2854,7 @@ Session::find_whole_file_parent (boost::shared_ptr child) const RegionFactory::RegionMap::const_iterator i; boost::shared_ptr region; - Glib::Mutex::Lock lm (region_lock); + Glib::Threads::Mutex::Lock lm (region_lock); for (i = regions.begin(); i != regions.end(); ++i) { @@ -2900,7 +2900,7 @@ Session::destroy_sources (list > srcs) for (list >::iterator s = srcs.begin(); s != srcs.end(); ) { { - Glib::Mutex::Lock ls (source_lock); + Glib::Threads::Mutex::Lock ls (source_lock); /* remove from the main source list */ sources.erase ((*s)->id()); } @@ -2953,7 +2953,7 @@ Session::add_source (boost::shared_ptr source) entry.second = source; { - Glib::Mutex::Lock lm (source_lock); + Glib::Threads::Mutex::Lock lm (source_lock); result = sources.insert (entry); } @@ -2998,7 +2998,7 @@ Session::remove_source (boost::weak_ptr src) } { - Glib::Mutex::Lock lm (source_lock); + Glib::Threads::Mutex::Lock lm (source_lock); if ((i = sources.find (source->id())) != sources.end()) { sources.erase (i); @@ -3018,7 +3018,7 @@ Session::remove_source (boost::weak_ptr src) boost::shared_ptr Session::source_by_id (const PBD::ID& id) { - Glib::Mutex::Lock lm (source_lock); + Glib::Threads::Mutex::Lock lm (source_lock); SourceMap::iterator i; boost::shared_ptr source; @@ -3032,7 +3032,7 @@ Session::source_by_id (const PBD::ID& id) boost::shared_ptr Session::source_by_path_and_channel (const string& path, uint16_t chn) { - Glib::Mutex::Lock lm (source_lock); + Glib::Threads::Mutex::Lock lm (source_lock); for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) { boost::shared_ptr afs @@ -3049,7 +3049,7 @@ uint32_t Session::count_sources_by_origin (const string& path) { uint32_t cnt = 0; - Glib::Mutex::Lock lm (source_lock); + Glib::Threads::Mutex::Lock lm (source_lock); for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) { boost::shared_ptr fs @@ -3514,7 +3514,7 @@ Session::graph_reordered () boost::optional Session::available_capture_duration () { - Glib::Mutex::Lock lm (space_lock); + Glib::Threads::Mutex::Lock lm (space_lock); if (_total_free_4k_blocks_uncertain) { return boost::optional (); @@ -4562,7 +4562,7 @@ void Session::initialize_latencies () { { - Glib::Mutex::Lock lm (_engine.process_lock()); + Glib::Threads::Mutex::Lock lm (_engine.process_lock()); update_latency (false); update_latency (true); } diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index 88f61335e0..1d235b051a 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include "pbd/error.h" #include "pbd/pthread_utils.h" diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc index abfbaecfcd..e6e8749aec 100644 --- a/libs/ardour/session_click.cc +++ b/libs/ardour/session_click.cc @@ -51,7 +51,7 @@ Session::click (framepos_t start, framecnt_t nframes) return; } - Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::WriterLock clickm (click_lock, Glib::Threads::TRY_LOCK); /* how far have we moved since the last time the clicks got cleared */ @@ -225,7 +225,7 @@ Session::setup_click_sounds (int which) void Session::clear_clicks () { - Glib::RWLock::WriterLock lm (click_lock); + Glib::Threads::RWLock::WriterLock lm (click_lock); for (Clicks::iterator i = clicks.begin(); i != clicks.end(); ++i) { delete *i; diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index acb23aee8b..1c1b4f9a0f 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -19,7 +19,7 @@ #include "pbd/error.h" -#include +#include #include #include diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index b833aea1f2..ac3baf2008 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -69,7 +69,7 @@ SessionPlaylists::~SessionPlaylists () bool SessionPlaylists::add (boost::shared_ptr playlist) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); bool const existing = find (playlists.begin(), playlists.end(), playlist) != playlists.end(); @@ -96,7 +96,7 @@ SessionPlaylists::remove_weak (boost::weak_ptr playlist) void SessionPlaylists::remove (boost::shared_ptr playlist) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); List::iterator i; @@ -129,7 +129,7 @@ SessionPlaylists::track (bool inuse, boost::weak_ptr wpl) } { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); if (!inuse) { @@ -154,14 +154,14 @@ SessionPlaylists::track (bool inuse, boost::weak_ptr wpl) uint32_t SessionPlaylists::n_playlists () const { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); return playlists.size(); } boost::shared_ptr SessionPlaylists::by_name (string name) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { if ((*i)->name() == name) { @@ -181,7 +181,7 @@ SessionPlaylists::by_name (string name) boost::shared_ptr SessionPlaylists::by_id (const PBD::ID& id) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { if ((*i)->id() == id) { @@ -201,7 +201,7 @@ SessionPlaylists::by_id (const PBD::ID& id) void SessionPlaylists::unassigned (std::list > & list) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { if (!(*i)->get_orig_track_id().to_s().compare ("0")) { @@ -219,7 +219,7 @@ SessionPlaylists::unassigned (std::list > & list) void SessionPlaylists::get (vector >& s) const { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { s.push_back (*i); @@ -233,7 +233,7 @@ SessionPlaylists::get (vector >& s) const void SessionPlaylists::destroy_region (boost::shared_ptr r) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { (*i)->destroy_region (r); @@ -270,7 +270,7 @@ SessionPlaylists::source_use_count (boost::shared_ptr src) const void SessionPlaylists::sync_all_regions_with_regions () { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); for (List::const_iterator p = playlists.begin(); p != playlists.end(); ++p) { (*p)->sync_all_regions_with_regions (); @@ -411,7 +411,7 @@ SessionPlaylists::XMLPlaylistFactory (Session& session, const XMLNode& node) boost::shared_ptr SessionPlaylists::find_crossfade (const PBD::ID& id) { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); boost::shared_ptr c; @@ -435,7 +435,7 @@ SessionPlaylists::find_crossfade (const PBD::ID& id) uint32_t SessionPlaylists::region_use_count (boost::shared_ptr region) const { - Glib::Mutex::Lock lm (lock); + Glib::Threads::Mutex::Lock lm (lock); uint32_t cnt = 0; for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index 6cebc13b0d..019f491a4a 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -25,7 +25,7 @@ #include "pbd/error.h" #include "pbd/enumwriter.h" -#include +#include #include "ardour/audioengine.h" #include "ardour/auditioner.h" diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6661d33c9a..3ef2e0d521 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -54,7 +54,7 @@ #include #include -#include +#include #include @@ -576,7 +576,7 @@ Session::create (const string& session_template, BusProfile* bus_profile) // boost_debug_shared_ptr_mark_interesting (r.get(), "Route"); #endif { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); r->input()->ensure_io (count, false, this); r->output()->ensure_io (count, false, this); } @@ -1043,7 +1043,7 @@ Session::state (bool full_state) child = node->add_child ("Sources"); if (full_state) { - Glib::Mutex::Lock sl (source_lock); + Glib::Threads::Mutex::Lock sl (source_lock); for (SourceMap::iterator siter = sources.begin(); siter != sources.end(); ++siter) { @@ -1070,7 +1070,7 @@ Session::state (bool full_state) child = node->add_child ("Regions"); if (full_state) { - Glib::Mutex::Lock rl (region_lock); + Glib::Threads::Mutex::Lock rl (region_lock); const RegionFactory::RegionMap& region_map (RegionFactory::all_regions()); for (RegionFactory::RegionMap::const_iterator i = region_map.begin(); i != region_map.end(); ++i) { boost::shared_ptr r = i->second; @@ -1879,7 +1879,7 @@ Session::get_sources_as_xml () { XMLNode* node = new XMLNode (X_("Sources")); - Glib::Mutex::Lock lm (source_lock); + Glib::Threads::Mutex::Lock lm (source_lock); for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) { node->add_child_nocopy (i->second->get_state()); @@ -2066,7 +2066,7 @@ Session::refresh_disk_space () { #if HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H - Glib::Mutex::Lock lm (space_lock); + Glib::Threads::Mutex::Lock lm (space_lock); /* get freespace on every FS that is part of the session path */ @@ -3003,7 +3003,7 @@ Session::add_controllable (boost::shared_ptr c) as part of the session. */ - Glib::Mutex::Lock lm (controllables_lock); + Glib::Threads::Mutex::Lock lm (controllables_lock); controllables.insert (c); } @@ -3016,7 +3016,7 @@ Session::remove_controllable (Controllable* c) return; } - Glib::Mutex::Lock lm (controllables_lock); + Glib::Threads::Mutex::Lock lm (controllables_lock); Controllables::iterator x = controllables.find (boost::shared_ptr(c, null_deleter())); @@ -3028,7 +3028,7 @@ Session::remove_controllable (Controllable* c) boost::shared_ptr Session::controllable_by_id (const PBD::ID& id) { - Glib::Mutex::Lock lm (controllables_lock); + Glib::Threads::Mutex::Lock lm (controllables_lock); for (Controllables::iterator i = controllables.begin(); i != controllables.end(); ++i) { if ((*i)->id() == id) { @@ -3387,7 +3387,7 @@ Session::config_changed (std::string p, bool ours) } else if (p == "edit-mode") { - Glib::Mutex::Lock lm (playlists->lock); + Glib::Threads::Mutex::Lock lm (playlists->lock); for (SessionPlaylists::List::iterator i = playlists->playlists.begin(); i != playlists->playlists.end(); ++i) { (*i)->set_edit_mode (Config->get_edit_mode ()); diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 795a106685..7502ded288 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -921,7 +921,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool /* this is functionally what clear_clicks() does but with a tentative lock */ - Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::WriterLock clickm (click_lock, Glib::Threads::TRY_LOCK); if (clickm.locked()) { diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 368982f10d..47c653a698 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -427,7 +427,7 @@ SMFSource::mark_streaming_write_completed () void SMFSource::mark_midi_streaming_write_completed (Evoral::Sequence::StuckNoteOption stuck_notes_option, Evoral::MusicalTime when) { - Glib::Mutex::Lock lm (_lock); + Glib::Threads::Mutex::Lock lm (_lock); MidiSource::mark_midi_streaming_write_completed (stuck_notes_option, when); if (!writable()) { @@ -459,9 +459,9 @@ SMFSource::load_model (bool lock, bool force_reload) return; } - boost::shared_ptr lm; + boost::shared_ptr lm; if (lock) - lm = boost::shared_ptr(new Glib::Mutex::Lock(_lock)); + lm = boost::shared_ptr(new Glib::Threads::Mutex::Lock(_lock)); if (_model && !force_reload) { return; diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index e9e3b00142..618dddc70b 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include "pbd/xml++.h" @@ -162,7 +162,7 @@ Source::set_state (const XMLNode& node, int version) bool Source::has_been_analysed() const { - Glib::Mutex::Lock lm (_analysis_lock); + Glib::Threads::Mutex::Lock lm (_analysis_lock); return _analysed; } @@ -170,7 +170,7 @@ void Source::set_been_analysed (bool yn) { { - Glib::Mutex::Lock lm (_analysis_lock); + Glib::Threads::Mutex::Lock lm (_analysis_lock); _analysed = yn; } @@ -292,14 +292,14 @@ void Source::dec_use_count () { #ifndef NDEBUG - gint oldval = g_atomic_int_exchange_and_add (&_use_count, -1); + gint oldval = g_atomic_int_add (&_use_count, -1); if (oldval <= 0) { cerr << "Bad use dec for " << name() << endl; abort (); } assert (oldval > 0); #else - g_atomic_int_exchange_and_add (&_use_count, -1); + g_atomic_int_add (&_use_count, -1); #endif } diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index b0803a9d34..da5980599d 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -50,8 +50,8 @@ using namespace std; using namespace PBD; PBD::Signal1 > SourceFactory::SourceCreated; -Glib::Cond* SourceFactory::PeaksToBuild; -Glib::StaticMutex SourceFactory::peak_building_lock = GLIBMM_STATIC_MUTEX_INIT; +Glib::Threads::Cond SourceFactory::PeaksToBuild; +Glib::Threads::Mutex SourceFactory::peak_building_lock; std::list > SourceFactory::files_with_peaks; static void @@ -65,7 +65,7 @@ peak_thread_work () wait: if (SourceFactory::files_with_peaks.empty()) { - SourceFactory::PeaksToBuild->wait (SourceFactory::peak_building_lock); + SourceFactory::PeaksToBuild.wait (SourceFactory::peak_building_lock); } if (SourceFactory::files_with_peaks.empty()) { @@ -87,10 +87,8 @@ peak_thread_work () void SourceFactory::init () { - PeaksToBuild = new Glib::Cond(); - for (int n = 0; n < 2; ++n) { - Glib::Thread::create (sigc::ptr_fun (::peak_thread_work), false); + Glib::Threads::Thread::create (sigc::ptr_fun (::peak_thread_work)); } } @@ -103,9 +101,9 @@ SourceFactory::setup_peakfile (boost::shared_ptr s, bool async) if (async) { - Glib::Mutex::Lock lm (peak_building_lock); + Glib::Threads::Mutex::Lock lm (peak_building_lock); files_with_peaks.push_back (boost::weak_ptr (as)); - PeaksToBuild->broadcast (); + PeaksToBuild.broadcast (); } else { diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index f96bb5a91a..a5016073bb 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -23,7 +23,7 @@ #include -#include +#include #include "pbd/xml++.h" #include "evoral/types.hpp" #include "ardour/debug.h" @@ -311,7 +311,7 @@ TempoMap::remove_tempo (const TempoSection& tempo, bool complete_operation) bool removed = false; { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); Metrics::iterator i; for (i = metrics.begin(); i != metrics.end(); ++i) { @@ -342,7 +342,7 @@ TempoMap::remove_meter (const MeterSection& tempo, bool complete_operation) bool removed = false; { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); Metrics::iterator i; for (i = metrics.begin(); i != metrics.end(); ++i) { @@ -488,7 +488,7 @@ TempoMap::replace_tempo (const TempoSection& ts, const Tempo& tempo, const BBT_T add_tempo (tempo, where); } else { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); /* cannot move the first tempo section */ *((Tempo*)&first) = tempo; recompute_map (false); @@ -502,7 +502,7 @@ void TempoMap::add_tempo (const Tempo& tempo, BBT_Time where) { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); /* new tempos always start on a beat */ where.ticks = 0; @@ -558,7 +558,7 @@ TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const BBT_T add_meter (meter, where); } else { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); /* cannot move the first meter section */ *((Meter*)&first) = meter; recompute_map (true); @@ -572,7 +572,7 @@ void TempoMap::add_meter (const Meter& meter, BBT_Time where) { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); /* a new meter always starts a new bar on the first beat. so round the start time appropriately. remember that @@ -612,7 +612,7 @@ TempoMap::change_initial_tempo (double beats_per_minute, double note_type) for (Metrics::iterator i = metrics.begin(); i != metrics.end(); ++i) { if ((t = dynamic_cast (*i)) != 0) { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); *((Tempo*) t) = newtempo; recompute_map (false); } @@ -662,7 +662,7 @@ TempoMap::change_existing_tempo_at (framepos_t where, double beats_per_minute, d /* reset */ { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); /* cannot move the first tempo section */ *((Tempo*)prev) = newtempo; recompute_map (false); @@ -706,7 +706,7 @@ TempoMap::first_tempo () const void TempoMap::require_map_to (framepos_t pos) { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); if (_map.empty() || _map.back().frame < pos) { extend_map (pos); @@ -716,7 +716,7 @@ TempoMap::require_map_to (framepos_t pos) void TempoMap::require_map_to (const BBT_Time& bbt) { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); /* since we have no idea where BBT is if its off the map, see the last * point in the map is past BBT, and if not add an arbitrary amount of @@ -1039,7 +1039,7 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter, TempoMetric TempoMap::metric_at (framepos_t frame) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); TempoMetric m (first_meter(), first_tempo()); const Meter* meter; const Tempo* tempo; @@ -1073,7 +1073,7 @@ TempoMap::metric_at (framepos_t frame) const TempoMetric TempoMap::metric_at (BBT_Time bbt) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); TempoMetric m (first_meter(), first_tempo()); const Meter* meter; const Tempo* tempo; @@ -1111,7 +1111,7 @@ TempoMap::bbt_time (framepos_t frame, BBT_Time& bbt) { require_map_to (frame); - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); if (frame < 0) { bbt.bars = 1; @@ -1127,7 +1127,7 @@ TempoMap::bbt_time (framepos_t frame, BBT_Time& bbt) void TempoMap::bbt_time_rt (framepos_t frame, BBT_Time& bbt) { - Glib::RWLock::ReaderLock lm (lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { throw std::logic_error ("TempoMap::bbt_time_rt() could not lock tempo map"); @@ -1170,7 +1170,7 @@ TempoMap::frame_time (const BBT_Time& bbt) require_map_to (bbt); - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); BBTPointList::const_iterator s = bbt_before_or_at (BBT_Time (1, 1, 0)); BBTPointList::const_iterator e = bbt_before_or_at (BBT_Time (bbt.bars, bbt.beats, 0)); @@ -1189,7 +1189,7 @@ TempoMap::bbt_duration_at (framepos_t pos, const BBT_Time& bbt, int dir) BBT_Time when; bbt_time (pos, when); - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); return bbt_duration_at_unlocked (when, bbt, dir); } @@ -1256,7 +1256,7 @@ TempoMap::round_to_beat_subdivision (framepos_t fr, int sub_num, int dir) { require_map_to (fr); - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); BBTPointList::const_iterator i = bbt_before_or_at (fr); BBT_Time the_beat; uint32_t ticks_one_subdivisions_worth; @@ -1375,7 +1375,7 @@ TempoMap::round_to_type (framepos_t frame, int dir, BBTPointType type) { require_map_to (frame); - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); BBTPointList::const_iterator fi; if (dir > 0) { @@ -1521,7 +1521,7 @@ TempoMap::get_grid (TempoMap::BBTPointList::const_iterator& begin, framepos_t lower, framepos_t upper) { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); if (_map.empty() || (_map.back().frame < upper)) { recompute_map (false, upper); } @@ -1534,7 +1534,7 @@ TempoMap::get_grid (TempoMap::BBTPointList::const_iterator& begin, const TempoSection& TempoMap::tempo_section_at (framepos_t frame) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); Metrics::const_iterator i; TempoSection* prev = 0; @@ -1580,7 +1580,7 @@ TempoMap::get_state () XMLNode *root = new XMLNode ("TempoMap"); { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); for (i = metrics.begin(); i != metrics.end(); ++i) { root->add_child_nocopy ((*i)->get_state()); } @@ -1593,7 +1593,7 @@ int TempoMap::set_state (const XMLNode& node, int /*version*/) { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); XMLNodeList nlist; XMLNodeConstIterator niter; @@ -1679,7 +1679,7 @@ TempoMap::set_state (const XMLNode& node, int /*version*/) void TempoMap::dump (std::ostream& o) const { - Glib::RWLock::ReaderLock lm (lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (lock, Glib::Threads::TRY_LOCK); const MeterSection* m; const TempoSection* t; @@ -1698,7 +1698,7 @@ TempoMap::dump (std::ostream& o) const int TempoMap::n_tempos() const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); int cnt = 0; for (Metrics::const_iterator i = metrics.begin(); i != metrics.end(); ++i) { @@ -1713,7 +1713,7 @@ TempoMap::n_tempos() const int TempoMap::n_meters() const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); int cnt = 0; for (Metrics::const_iterator i = metrics.begin(); i != metrics.end(); ++i) { @@ -1729,7 +1729,7 @@ void TempoMap::insert_time (framepos_t where, framecnt_t amount) { { - Glib::RWLock::WriterLock lm (lock); + Glib::Threads::RWLock::WriterLock lm (lock); for (Metrics::iterator i = metrics.begin(); i != metrics.end(); ++i) { if ((*i)->frame() >= where && (*i)->movable ()) { (*i)->set_frame ((*i)->frame() + amount); @@ -1825,7 +1825,7 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount) framepos_t TempoMap::framepos_plus_beats (framepos_t pos, Evoral::MusicalTime beats) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); Metrics::const_iterator next_tempo; const TempoSection* tempo = 0; @@ -1914,7 +1914,7 @@ TempoMap::framepos_plus_beats (framepos_t pos, Evoral::MusicalTime beats) const framepos_t TempoMap::framepos_minus_beats (framepos_t pos, Evoral::MusicalTime beats) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); Metrics::const_reverse_iterator prev_tempo; const TempoSection* tempo = 0; @@ -2023,7 +2023,7 @@ TempoMap::framepos_minus_beats (framepos_t pos, Evoral::MusicalTime beats) const framepos_t TempoMap::framepos_plus_bbt (framepos_t pos, BBT_Time op) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); Metrics::const_iterator i; const MeterSection* meter; const MeterSection* m; @@ -2161,7 +2161,7 @@ TempoMap::framepos_plus_bbt (framepos_t pos, BBT_Time op) const Evoral::MusicalTime TempoMap::framewalk_to_beats (framepos_t pos, framecnt_t distance) const { - Glib::RWLock::ReaderLock lm (lock); + Glib::Threads::RWLock::ReaderLock lm (lock); Metrics::const_iterator next_tempo; const TempoSection* tempo = 0; framepos_t effective_pos = max (pos, (framepos_t) 0); diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 452a0843e2..92e51a4250 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -255,7 +255,7 @@ void Track::deactivate_visible_processors () { _deactivated_processors.clear (); - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { if ((*i)->active() && (*i)->display_to_user() && boost::dynamic_pointer_cast (*i) == 0) { @@ -365,7 +365,7 @@ Track::set_latency_compensation (framecnt_t longest_session_latency) int Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return 0; } @@ -448,7 +448,7 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/, bool& need_butler) { - Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { return 0; } @@ -908,7 +908,7 @@ Track::check_initial_delay (framecnt_t nframes, framepos_t& transport_frame) to reflect that we just wrote _roll_delay frames of silence. */ - Glib::RWLock::ReaderLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { boost::shared_ptr iop = boost::dynamic_pointer_cast (*i); if (iop) { diff --git a/libs/ardour/user_bundle.cc b/libs/ardour/user_bundle.cc index de71a87d86..2655d6bc7d 100644 --- a/libs/ardour/user_bundle.cc +++ b/libs/ardour/user_bundle.cc @@ -90,7 +90,7 @@ ARDOUR::UserBundle::get_state () node->add_property ("name", name ()); { - Glib::Mutex::Lock lm (_channel_mutex); + Glib::Threads::Mutex::Lock lm (_channel_mutex); for (std::vector::iterator i = _channel.begin(); i != _channel.end(); ++i) { XMLNode* c = new XMLNode ("Channel"); diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc index c108f653c4..290689f13c 100644 --- a/libs/ardour/worker.cc +++ b/libs/ardour/worker.cc @@ -26,7 +26,7 @@ namespace ARDOUR { Worker::Worker(Workee* workee, uint32_t ring_size) : _workee(workee) - , _thread(Glib::Thread::create(sigc::mem_fun(*this, &Worker::run), true)) + , _thread (Glib::Threads::Thread::create(sigc::mem_fun(*this, &Worker::run))) , _requests(new RingBuffer(ring_size)) , _responses(new RingBuffer(ring_size)) , _response((uint8_t*)malloc(ring_size)) -- cgit v1.2.3