convert from Glib:: to Glib::Threads for all thread-related API
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Jul 2012 17:48:55 +0000 (17:48 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Jul 2012 17:48:55 +0000 (17:48 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf

138 files changed:
gtk2_ardour/analysis_window.cc
gtk2_ardour/analysis_window.h
gtk2_ardour/fft_graph.cc
gtk2_ardour/mixer_ui.cc
gtk2_ardour/processor_box.cc
gtk2_ardour/route_params_ui.cc
gtk2_ardour/strip_silence_dialog.cc
gtk2_ardour/strip_silence_dialog.h
libs/ardour/amp.cc
libs/ardour/analyser.cc
libs/ardour/ardour/analyser.h
libs/ardour/ardour/audioengine.h
libs/ardour/ardour/audiosource.h
libs/ardour/ardour/auditioner.h
libs/ardour/ardour/auto_bundle.h
libs/ardour/ardour/automation_list.h
libs/ardour/ardour/automation_watch.h
libs/ardour/ardour/buffer_manager.h
libs/ardour/ardour/bundle.h
libs/ardour/ardour/butler.h
libs/ardour/ardour/control_protocol_manager.h
libs/ardour/ardour/diskstream.h
libs/ardour/ardour/graph.h
libs/ardour/ardour/internal_return.h
libs/ardour/ardour/io.h
libs/ardour/ardour/io_processor.h
libs/ardour/ardour/location.h
libs/ardour/ardour/logcurve.h
libs/ardour/ardour/midi_diskstream.h
libs/ardour/ardour/midi_model.h
libs/ardour/ardour/midi_source.h
libs/ardour/ardour/playlist.h
libs/ardour/ardour/process_thread.h
libs/ardour/ardour/region_factory.h
libs/ardour/ardour/route.h
libs/ardour/ardour/session.h
libs/ardour/ardour/session_playlist.h
libs/ardour/ardour/session_playlists.h
libs/ardour/ardour/session_route.h
libs/ardour/ardour/slave.h
libs/ardour/ardour/source.h
libs/ardour/ardour/source_factory.h
libs/ardour/ardour/tempo.h
libs/ardour/ardour/thread_buffers.h
libs/ardour/ardour/user_bundle.h
libs/ardour/ardour/worker.h
libs/ardour/audio_diskstream.cc
libs/ardour/audio_playlist_source.cc
libs/ardour/audio_track.cc
libs/ardour/audio_unit.cc
libs/ardour/audioengine.cc
libs/ardour/audiofilesource.cc
libs/ardour/audioregion.cc
libs/ardour/audiosource.cc
libs/ardour/auditioner.cc
libs/ardour/auto_bundle.cc
libs/ardour/automatable.cc
libs/ardour/automation_watch.cc
libs/ardour/buffer_manager.cc
libs/ardour/bundle.cc
libs/ardour/butler.cc
libs/ardour/control_protocol_manager.cc
libs/ardour/diskstream.cc
libs/ardour/file_source.cc
libs/ardour/graph.cc
libs/ardour/internal_return.cc
libs/ardour/io.cc
libs/ardour/location.cc
libs/ardour/midi_diskstream.cc
libs/ardour/midi_model.cc
libs/ardour/midi_region.cc
libs/ardour/midi_source.cc
libs/ardour/midi_stretch.cc
libs/ardour/midi_track.cc
libs/ardour/mtc_slave.cc
libs/ardour/plugin_insert.cc
libs/ardour/process_thread.cc
libs/ardour/region.cc
libs/ardour/region_factory.cc
libs/ardour/return.cc
libs/ardour/route.cc
libs/ardour/session.cc
libs/ardour/session_butler.cc
libs/ardour/session_click.cc
libs/ardour/session_export.cc
libs/ardour/session_playlists.cc
libs/ardour/session_process.cc
libs/ardour/session_state.cc
libs/ardour/session_transport.cc
libs/ardour/smf_source.cc
libs/ardour/source.cc
libs/ardour/source_factory.cc
libs/ardour/tempo.cc
libs/ardour/track.cc
libs/ardour/user_bundle.cc
libs/ardour/worker.cc
libs/audiographer/audiographer/general/threader.h
libs/audiographer/tests/test_runner.cc
libs/evoral/evoral/ControlList.hpp
libs/evoral/evoral/ControlSet.hpp
libs/evoral/evoral/Sequence.hpp
libs/evoral/src/ControlList.cpp
libs/evoral/src/ControlSet.cpp
libs/evoral/src/Curve.cpp
libs/gtkmm2ext/gtk_ui.cc
libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
libs/midi++2/ipmidi_port.cc
libs/midi++2/jack_midi_port.cc
libs/midi++2/midi++/ipmidi_port.h
libs/midi++2/midi++/jack_midi_port.h
libs/pbd/base_ui.cc
libs/pbd/boost_debug.cc
libs/pbd/controllable.cc
libs/pbd/event_loop.cc
libs/pbd/file_manager.cc
libs/pbd/id.cc
libs/pbd/pbd/abstract_ui.cc
libs/pbd/pbd/abstract_ui.h
libs/pbd/pbd/base_ui.h
libs/pbd/pbd/controllable.h
libs/pbd/pbd/event_loop.h
libs/pbd/pbd/file_manager.h
libs/pbd/pbd/id.h
libs/pbd/pbd/pool.h
libs/pbd/pbd/rcu.h
libs/pbd/pbd/sndfile_manager.h
libs/pbd/pbd/stacktrace.h
libs/pbd/pbd/stateful.h
libs/pbd/pool.cc
libs/pbd/pthread_utils.cc
libs/pbd/stateful.cc
libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
libs/surfaces/generic_midi/generic_midi_control_protocol.cc
libs/surfaces/generic_midi/generic_midi_control_protocol.h
libs/surfaces/mackie/mackie_control_protocol.h
libs/surfaces/mackie/surface_port.h
libs/surfaces/tranzport/tranzport_control_protocol.h
libs/surfaces/wiimote/wiimote.h

index c4948f50924cb4ad216ceef05f44091ecdb688a6..e93fad887cd01227e50022704af59db524637877 100644 (file)
@@ -239,7 +239,7 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
 {
        track_list_ready = false;
        {
-               Glib::Mutex::Lock lm  (track_list_lock);
+               Glib::Threads::Mutex::Lock lm  (track_list_lock);
 
                // Empty track list & free old graphs
                clear_tracklist();
index 19ef84069af7a0f819406cce0593d74dbcdc5cc9..af540b9173e89c5b2423e97778568bb089c4e422 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <gtkmm2ext/dndtreeview.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/session_handle.h"
 
@@ -116,7 +116,7 @@ private:
        FFTGraph fft_graph;
 
        bool track_list_ready;
-       Glib::Mutex track_list_lock;
+       Glib::Threads::Mutex track_list_lock;
 
        friend class FFTGraph;
 };
index c0171ce57b8ab88536748f63ec7e58e5322c4bf7..2b0b32a28a5614d1ef09d0a97f4a261d1f0458e0 100644 (file)
@@ -61,7 +61,7 @@ void
 FFTGraph::setWindowSize(int windowSize)
 {
        if (_a_window) {
-               Glib::Mutex::Lock lm  (_a_window->track_list_lock);
+               Glib::Threads::Mutex::Lock lm  (_a_window->track_list_lock);
                setWindowSize_internal(windowSize);
        } else {
                setWindowSize_internal(windowSize);
@@ -268,7 +268,7 @@ FFTGraph::draw_scales(Glib::RefPtr<Gdk::Window> window)
 void
 FFTGraph::redraw()
 {
-       Glib::Mutex::Lock lm  (_a_window->track_list_lock);
+       Glib::Threads::Mutex::Lock lm  (_a_window->track_list_lock);
 
        draw_scales(get_window());
 
index 1babbca55696edb5542810939dd5f411b4ace2b9..a141999277e08877b743ab6b3d1bb2b015f8eaec 100644 (file)
@@ -30,7 +30,7 @@
 #include "pbd/convert.h"
 #include "pbd/unwind.h"
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include <gtkmm2ext/gtk_ui.h>
 #include <gtkmm2ext/utils.h>
index 68ca80ff05117cc0b4c14562b2a2ce86f8b6d0bf..2cb561172ee3b4262a0e9f9a865ce5b18d8a55f8 100644 (file)
@@ -1236,7 +1236,7 @@ ProcessorBox::choose_send ()
 
        /* XXX need processor lock on route */
        try {
-               Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock());
+               Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock());
                send->output()->ensure_io (outs, false, this);
        } catch (AudioEngine::PortRegistrationFailure& err) {
                error << string_compose (_("Cannot set up new send: %1"), err.what()) << endmsg;
index ca673954d45ad5dd77584f93ea9e97f8367bf0e7..5f06555f280b39a26cdee720a4c32c231cd953e8 100644 (file)
@@ -20,7 +20,7 @@
 #include <algorithm>
 #include <inttypes.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/window_title.h>
 
index 32e7bc60545d81b562b8884be3a383de5042e7cb..2fb4b5923f9cd122a96f321fed20f6f03a52467a 100644 (file)
@@ -187,7 +187,7 @@ void
 StripSilenceDialog::update_silence_rects ()
 {
        /* Lock so that we don't contend with the detection thread for access to the silence regions */
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
         double const y = _threshold.get_value();
 
         for (list<ViewInterval>::iterator v = views.begin(); v != views.end(); ++v) {
index 18313941c15496835ff148e240826e9ed0d85f15..5ba88812d7daf90d01ad6ea769a46496766914de 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include <gtkmm/spinbutton.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/types.h"
 #include "ardour_dialog.h"
@@ -84,8 +84,8 @@ private:
        pthread_t _thread; ///< thread to compute silence in the background
        static void * _detection_thread_work (void *);
        void * detection_thread_work ();
-       Glib::Mutex _lock; ///< lock held while the thread is doing work
-       Glib::Cond _run_cond; ///< condition to wake the thread
+       Glib::Threads::Mutex _lock; ///< lock held while the thread is doing work
+       Glib::Threads::Cond  _run_cond; ///< condition to wake the thread
        bool _thread_should_finish; ///< true if the thread should terminate
        PBD::Signal0<void> Completed; ///< emitted when a silence detection has completed
        PBD::ScopedConnection _completed_connection;
index 80dd7422e9a89d70f1ba4bc1f080235f12cd4db2..d68f73ef3e55572662db2df8989186ade696dfa4 100644 (file)
@@ -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);
index 730ea4169ad73d234759267b1e1323cfd26de3c5..bf98ecc20ab406a30c5e675c0c9ecb6337914202 100644 (file)
@@ -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<boost::weak_ptr<Source> > 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<Source> 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<Source>(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()) {
index 15e4220ad696c5aadcd7cdfa9f5c4d8b717df94c..aae16e443fa06c3f8960699bc8a54bdc1a462667 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __ardour_analyser_h__
 #define __ardour_analyser_h__
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/shared_ptr.hpp>
 
 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<boost::weak_ptr<Source> > analysis_queue;
 
        static void analyse_audio_file_source (boost::shared_ptr<AudioFileSource>);
index 73e40e8ab4abe39adbe3291dc31064bd850fc767..1c0d0f1a55eb56d10649c7bbe11af4169f7beaf7 100644 (file)
@@ -31,7 +31,7 @@
 #include <exception>
 #include <string>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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> ports;
index c6ec2a56ada30e0a905c2817b595a6943115022e..cbdcd296af6152e4f07abbec7af4754c04f699f7 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <time.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/function.hpp>
 
 #include "ardour/source.h"
@@ -118,7 +118,7 @@ class AudioSource : virtual public Source,
 
        static std::vector<boost::shared_ptr<Sample> > _mixdown_buffers;
        static std::vector<boost::shared_ptr<gain_t> > _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;
index 3650f0c92c898c99ca16aeb3e931a16eeaed08b5..bdd04fcc66d72f02bb4df3f62d038af00a797968 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <string>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/ardour.h"
 #include "ardour/audio_track.h"
@@ -62,7 +62,7 @@ class Auditioner : public AudioTrack
        boost::shared_ptr<AudioRegion> the_region;
        framepos_t current_frame;
        mutable gint _auditioning;
-       Glib::Mutex lock;
+       Glib::Threads::Mutex lock;
        framecnt_t length;
        bool via_monitor;
 
index b41a5d344fba5440dd10b82ff738557bdb728644..d97080c0897e584d9919778e2b3c5aa960104dc5 100644 (file)
@@ -21,7 +21,7 @@
 #define __ardour_auto_bundle_h__
 
 #include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "ardour/bundle.h"
 
 namespace ARDOUR {
index 01c9d0641ac2bd1f41886d1a047b6d2c360aa1c5..e7377d6b026b049d334912a8e912e32f9afb0241 100644 (file)
@@ -24,7 +24,7 @@
 #include <list>
 #include <cmath>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/undo.h"
 #include "pbd/xml++.h"
index bb5ef69385661b5697ccda3bf75a114bd644a30d..6fd5a0eb65e9a5c7983ebb7ecbe3285139a09e7d 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <list>
 #include <boost/shared_ptr.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <sigc++/signal.h>
 
 #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 ();
index e3ac981e63b6cce4ff2683c542355b79e2f57f11..2a8e7be6da95d7f01d85655b382f683b861dd44b 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "ardour/chan_count.h"
 #include <list>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 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<ThreadBuffers*> ThreadBufferFIFO;
        typedef std::list<ThreadBuffers*> ThreadBufferList;
index e84349c647698a724b5e00caa347f49d5cfc4ffe..02845481b61a4c67a5282cfffbfa8290281368e7 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <string>
 #include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/shared_ptr.hpp>
 
 #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> _channel;
 
   private:
index 061c94d910a754690163cad2d0932584d1ecfcc5..cdd48c3e3a2c655a89718b5320e65ff675eeb8ab 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __ardour_butler_h__
 #define __ardour_butler_h__
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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];
index 20358025f10ca78f20e1614ec3c4693bbc157aaa..80c966876341b54589b1a759690e8a8cec9aca3b 100644 (file)
@@ -24,7 +24,7 @@
 #include <list>
 
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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<ControlProtocol*>    control_protocols;
 
        void session_going_away ();
index bbc3a85dbe9f40cbbd0ae771c0efe7d7bc4492dc..5d3693052dada42cd4c9888aa180df5f2a9eaa60 100644 (file)
@@ -250,7 +250,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
 
        static framecnt_t disk_io_chunk_frames;
        std::vector<CaptureInfo*> 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;
 
index e5c03ad1342ada6e61749b8f9badf6ff17bc3618..cac09d34af386ee8a3ec8ac5c606646e31720c3a 100644 (file)
@@ -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;
index 291b51896ca2434cc5e32dba604f5296561e5be2..c7fe04cc4229a9072609e9929fbf96f96c420cf9 100644 (file)
@@ -48,7 +48,7 @@ class InternalReturn : public Return
        /** sends that we are receiving data from */
        std::list<InternalSend*> _sends;
        /** mutex to protect _sends */
-       Glib::Mutex _sends_mutex;
+       Glib::Threads::Mutex _sends_mutex;
 };
 
 } // namespace ARDOUR
index d38aa885768da62e30e543ae54239968fbdf73e9..69297fff0452dff75a4d070e0aafd5e79ff33e18 100644 (file)
@@ -25,7 +25,7 @@
 #include <cmath>
 #include <jack/jack.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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;
index 3d59230b26d94abb61f32fb403c1d33efcc021be..7adfab2225ebe6c0972dc4514b913af41ccc6732 100644 (file)
@@ -23,7 +23,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/undo.h"
 
index 069230438e8979f97e31a9a5dc72e444acac3389..414f332b5e02e430e51643a4a263cb0db90dd5a3 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <sys/types.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/undo.h"
 #include "pbd/stateful.h"
@@ -181,12 +181,12 @@ class Locations : public SessionHandleRef, public PBD::StatefulDestructible
        PBD::Signal1<void,const PBD::PropertyChange&>    StateChanged;
 
        template<class T> void apply (T& obj, void (T::*method)(LocationList&)) {
-               Glib::Mutex::Lock lm (lock);
+               Glib::Threads::Mutex::Lock lm (lock);
                (obj.*method)(locations);
        }
 
        template<class T1, class T2> 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*);
index a5f0ce4734076f052f7c40cf2f299c46f56ae35f..4c91ad9a792952fbbe3a7ce0083ea87276f93a62 100644 (file)
@@ -21,7 +21,7 @@
 #define __ardour_logcurve_h__
 
 #include "pbd/fastlog.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 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;
index 99513734da9136b0b3d80e6dba89ec8887d16b1a..0823a5f8ac998290e787f4759566a996308f078a 100644 (file)
@@ -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 */
index d0a05e131d5a83fd04f64a84fc1bf9fc6dcd0380..38bd3ab982f26d1df57c90728e8a625472f11d6f 100644 (file)
@@ -25,7 +25,7 @@
 #include <deque>
 #include <utility>
 #include <boost/utility.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/command.h"
 #include "ardour/types.h"
 #include "ardour/midi_buffer.h"
@@ -267,14 +267,14 @@ protected:
 
 private:
        struct WriteLockImpl : public AutomatableSequence<TimeType>::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<TimeType>::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:
index 1d4ba56ba38501599374fad26f3714377530ff06..1a7f3b07c570abada94f9fa1a80869df548b34d2 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <string>
 #include <time.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/enable_shared_from_this.hpp>
 #include "pbd/stateful.h"
 #include "pbd/xml++.h"
index a64ebdd727c5602420a6c828811fe6fe0b10e89c..6de772390ea5f87b7cb469d756d31b66cc7654cc 100644 (file)
@@ -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 &);
index 6dd91aa305cc52e2ca59b67597230181a2df2f3a..871a2584d5df17273d9d9409ad3f64e37d0af7ab 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __libardour_process_thread__
 #define __libardour_process_thread__
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/chan_count.h"
 #include "ardour/types.h"
@@ -36,7 +36,7 @@ protected:
        void session_going_away ();
 
 private:
-       static Glib::Private<ThreadBuffers>* _private_thread_buffers;
+    static Glib::Threads::Private<ThreadBuffers> _private_thread_buffers;
 };
 
 } // namespace
index 471f172440509548d5aaf24fed11ef92127323d3..ed0c962d879a7adae199e410b830a56d574e6984 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <map>
 #include <set>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/id.h"
 #include "pbd/property_list.h"
@@ -124,11 +124,11 @@ public:
 
        static void region_changed (PBD::PropertyChange const &, boost::weak_ptr<Region>);
 
-       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<std::string, uint32_t> region_name_number_map;
        /** map of complete region names with their region ID */
index 62a694071f863c293d0df0cbcd2aab3f48b53411..b2e3d1236e86eaf70641dfdb300419cefc35b979 100644 (file)
@@ -32,7 +32,7 @@
 #include <boost/dynamic_bitset.hpp>
 #include <boost/enable_shared_from_this.hpp>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #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<void(boost::weak_ptr<Processor>)> 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<UnknownProcessor> (*i)) {
                                break;
@@ -201,7 +201,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
        }
 
        boost::shared_ptr<Processor> 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<Delivery> _main_outs;
        boost::shared_ptr<InternalSend> _monitor_send;
        boost::shared_ptr<InternalReturn> _intreturn;
index 780c68f2b0ab2f86dfcaaf15e3b4fa25cdee5f5b..5f20df029c38b1f24edc7f90b06f332743153950 100644 (file)
@@ -34,7 +34,7 @@
 #include <boost/weak_ptr.hpp>
 #include <boost/utility.hpp>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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<PBD::ID,boost::shared_ptr<Source> > 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<std::string>& result, bool exclude_this_snapshot);
 
        typedef std::set<boost::shared_ptr<PBD::Controllable> > Controllables;
-       Glib::Mutex controllables_lock;
+       Glib::Threads::Mutex controllables_lock;
        Controllables controllables;
 
        boost::shared_ptr<PBD::Controllable> _solo_cut_control;
index 7f5d1e89ce49a894cc4214cc30c4f8e01102ef37..fa1acc58287db3f57ba65515ac37b51420e98064 100644 (file)
@@ -29,7 +29,7 @@ namespace ARDOUR {
 template<class T> void
 SessionPlaylists::foreach (T *obj, void (T::*func)(boost::shared_ptr<Playlist>))
 {
-       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);
index 5f69ba800135cff310864b64772ca000568b4e8a..83dc8ee58c7cd12921876e93bd6d486dc36f92a8 100644 (file)
@@ -23,7 +23,7 @@
 #include <set>
 #include <vector>
 #include <string>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 
@@ -78,7 +78,7 @@ private:
        int load_unused (Session &, const XMLNode&);
        boost::shared_ptr<Playlist> XMLPlaylistFactory (Session &, const XMLNode&);
 
-       mutable Glib::Mutex lock;
+       mutable Glib::Threads::Mutex lock;
        typedef std::set<boost::shared_ptr<Playlist> > List;
        List playlists;
        List unused_playlists;
index cfaa13cdc8c354f182e224c2fd17b0524e84f407..19d8614d1b40221fe4bad6e470f240634ff58a67 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <iostream>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/session.h"
 #include "ardour/route.h"
index a487824e519262c6b539049d258d33102e5348e1..1602b8bc8ee0e33f1aac8459f83ca612b4f06fda 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <vector>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include <jack/jack.h>
 
@@ -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;
 
index e65b4cb093fe1b87a6c0eaa4e53850e290808266..a3b5fd817a14f9d4b308c81d4b4c027a8cefa12f 100644 (file)
@@ -23,7 +23,7 @@
 #include <string>
 #include <set>
 
-#include <glib.h>
+#include <glibmm/threads.h>
 
 #include <boost/utility.hpp>
 #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 */
 
index 5ddf1f8735bf556b925269c0e00b3217500de9a8..387a40aff32326443a7d0d9e775f99050d0b7659 100644 (file)
@@ -24,6 +24,8 @@
 #include <stdint.h>
 #include <boost/shared_ptr.hpp>
 
+#include <glibmm/threads.h>
+
 #include "ardour/source.h"
 
 class XMLNode;
@@ -59,8 +61,8 @@ class SourceFactory {
                (DataType type, Session& s, boost::shared_ptr<Playlist> 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<AudioSource> > files_with_peaks;
 
        static int setup_peakfile (boost::shared_ptr<Source>, bool async);
index 15032b87419c6ff15414b4e60c4763b9d3839052..8e4f1bc420a0c4cd9fb032ce9958ae0b055fd6b7 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <vector>
 #include <cmath>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/undo.h"
 #include "pbd/stateful.h"
@@ -218,7 +218,7 @@ class TempoMap : public PBD::StatefulDestructible
        typedef std::vector<BBTPoint> BBTPointList;
 
        template<class T> 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);
index be8cb4228272b996bf6fd9e2a1cf87f21013d245..9011e98e4389583aef69266c82689099984b4be6 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __libardour_thread_buffers__
 #define __libardour_thread_buffers__
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/chan_count.h"
 #include "ardour/types.h"
index c124e2e722a1869d0039b4c4361eed8b402fff5f..5ecfe521f53a0bc05ec68cdaf2fdc5adec8b1d49 100644 (file)
@@ -21,7 +21,7 @@
 #define __ardour_user_bundle_h__
 
 #include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/stateful.h"
 #include "ardour/bundle.h"
 
index 984e375c8058275b9c43d2267db6bf8e1e2f8f4b..fe278b9618280fcf31c4518af1b164f633095c82 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <stdint.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/ringbuffer.h"
 #include "pbd/semaphore.h"
@@ -76,13 +76,13 @@ public:
 private:
        void run();
 
-       Workee*              _workee;
-       Glib::Thread*        _thread;
-       RingBuffer<uint8_t>* _requests;
-       RingBuffer<uint8_t>* _responses;
-       uint8_t*             _response;
-       PBD::Semaphore       _sem;
-       bool                 _exit;
+       Workee*                _workee;
+        Glib::Threads::Thread* _thread;
+       RingBuffer<uint8_t>*   _requests;
+       RingBuffer<uint8_t>*   _responses;
+       uint8_t*               _response;
+       PBD::Semaphore         _sem;
+       bool                   _exit;
 };
 
 } // namespace ARDOUR
index 8e6b5c27f1af8cfd917d43f10bf246c087b47cb3..3345a00b423deedbb7217a9047c350c03db53f11 100644 (file)
@@ -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<ChannelList> 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;
index ea09d200561360638e1273d8d626de5df7260e2e..915aee9595ec685293148965911fbf75e018001f 100644 (file)
@@ -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];
        }
index 4079cdb481153d26be627c9c73f5f59afa5e6ef0..2801a4e99780bd107f1b0e6654cec8411378332b 100644 (file)
@@ -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<Sample> mix_buffer (new Sample[nframes]);
        boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
 
-       Glib::RWLock::ReaderLock rlock (_processor_lock);
+       Glib::Threads::RWLock::ReaderLock rlock (_processor_lock);
 
        boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(diskstream->playlist());
 
@@ -557,7 +557,7 @@ AudioTrack::bounceable (boost::shared_ptr<Processor> 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<FreezeRecordProcessorInfo*>::iterator ii = _freeze_record.processor_info.begin(); ii != _freeze_record.processor_info.end(); ++ii) {
                                        if ((*ii)->id == (*i)->id()) {
index f7f3587e7d0dbcdaf10be96db36923e946f0ef34..89aa99bac8f5f903f98d0b81b7d63c6d72618982 100644 (file)
@@ -31,7 +31,7 @@
 #include "pbd/pathscanner.h"
 #include "pbd/locale_guard.h"
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <glibmm/fileutils.h>
 #include <glibmm/miscutils.h>
 
index 004ba33a6e235e4bc98731cee347d927ff5bf765..450bf2a2961f9df696e3d40210049fd6e5c27647 100644 (file)
@@ -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<Ports> 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;
        }
index e101f5b25b31710d2badb4a249283b6c7d8032d8..2486d45ca1c21cd13983af534a4ea540fb2a9e2d 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/audiofilesource.h"
 #include "ardour/debug.h"
@@ -86,7 +86,7 @@ struct SizedSampleBuffer {
        }
 };
 
-Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT;
+Glib::Threads::Private<SizedSampleBuffer> thread_interleave_buffer;
 
 /** Constructor used for existing external-to-session files. */
 AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags)
index 41b3ceedc9ac11fc00ca5172c7272b79b8ec84bf..577f12c78e8ed2c75eba41a6b3997a5e0fa91b49 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <boost/scoped_array.hpp>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/basename.h"
 #include "pbd/xml++.h"
index e33a3d30dee670352ea62318b07d59c866c7a26d..4deb053cd8f0bf3a2b4a06d6db878447b0d2eac9 100644 (file)
@@ -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<boost::shared_ptr<Sample> > AudioSource::_mixdown_buffers;
 vector<boost::shared_ptr<gain_t> > AudioSource::_gain_buffers;
 size_t AudioSource::_working_buffers_size = 0;
@@ -160,7 +160,7 @@ bool
 AudioSource::peaks_ready (boost::function<void()> 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);
 }
 
index 6c143568c43c30a37dc005ec562d86d6b27a4be7..ad4d8b5d16fb49edb93ae8d981ff6459f0c4e980 100644 (file)
@@ -17,7 +17,7 @@
 
 */
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/error.h"
 
@@ -136,7 +136,7 @@ Auditioner::audition_region (boost::shared_ptr<Region> 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> 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"),
index bedb270dc54be602a4f46f56836ae4fbb97c20b8..366d32b9790c3425c61a7b9241c249a278c61b88 100644 (file)
@@ -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;
 }
index 608ae745de36516575b705a71e950b4095e8d5db..0f6fbdbe17c6501a669fc84f8e21a7bb1e3674d8 100644 (file)
@@ -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<Evoral::Control> 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<AutomationControl>(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<Evoral::Parameter> 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<AutomationControl> 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<AutomationControl> 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<Evoral::Control> c = control(param);
        boost::shared_ptr<AutomationList> l = boost::dynamic_pointer_cast<AutomationList>(c->list());
index 5fefcaca8de22b1e9ff8b6c598f09fc050af9534..d3138ee336e9202b1df54a9947765ada011e1f0c 100644 (file)
@@ -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<AutomationControl> 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<AutomationControl
 void
 AutomationWatch::remove_automation_watch (boost::shared_ptr<AutomationControl> 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", 
index 71ff4946f3ff86303825724a452850b3164f8470..c8819e41cbe10e7e111a9fdfda7acd0bd814eeb6 100644 (file)
@@ -29,7 +29,7 @@ using namespace PBD;
 
 RingBufferNPT<ThreadBuffers*>* BufferManager::thread_buffers = 0;
 std::list<ThreadBuffers*>* 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;
 }
index 5040882b7a32fc0e334a4516778e4ab6b10c9765..f38fe0c42f7234173d1068c2d4e1d39992535104 100644 (file)
@@ -67,7 +67,7 @@ Bundle::Bundle (boost::shared_ptr<Bundle> other)
 ChanCount
 Bundle::nchannels () const
 {
-       Glib::Mutex::Lock lm (_channel_mutex);
+       Glib::Threads::Mutex::Lock lm (_channel_mutex);
 
        ChanCount c;
        for (vector<Channel>::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<Channel>::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<Channel>::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<Channel>::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;
        
index 3e9c7b0d96e18105ea541f4ba6cea399d796d456..db1b316368e7d1b0fc3f4cb5e6ba72a48cefc33f 100644 (file)
@@ -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);
index 509f883aed43ab59816f3190cbfad42706d5c0a7..8611447a93592a33397fdda846e1ced9e5397ff2 100644 (file)
@@ -46,7 +46,7 @@ ControlProtocolManager::ControlProtocolManager ()
 
 ControlProtocolManager::~ControlProtocolManager()
 {
-       Glib::Mutex::Lock lm (protocols_lock);
+       Glib::Threads::Mutex::Lock lm (protocols_lock);
 
        for (list<ControlProtocol*>::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<ControlProtocolInfo*>::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<ControlProtocol*>::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<ControlProtocol*>::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<ControlProtocolInfo*>::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<ControlProtocolInfo*>::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<ControlProtocol*>::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) {
                (*p)->midi_connectivity_established ();
index 7a0b0a81b1bdc255a253fa06dd0fbd1f3cc533c5..553e29244f026c104f21d167d06bad5087320621 100644 (file)
@@ -31,7 +31,7 @@
 #include <sys/stat.h>
 #include <sys/mman.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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> playlist)
         bool prior_playlist = false;
 
        {
-               Glib::Mutex::Lock lm (state_lock);
+               Glib::Threads::Mutex::Lock lm (state_lock);
 
                if (playlist == _playlist) {
                        return 0;
index 3017615948916158c56bcadeb2fcbbacf855002b..cd39faa08ed67efad91c81042a9e87e71ee1eb1d 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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);
 
index 300271c21a29a17e3c3d1a48085d586919cc0192..d2fbdbf552f3313c896380e40196e3b62806f093 100644 (file)
@@ -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> 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));
index ad2ed81194ece50b686f74c68aa0f1fda352ec43..af6b6110b632b4c4d38d06349ce509b96932e284 100644 (file)
@@ -16,7 +16,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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<InternalSend*>::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);
 }
 
index 01a4a64a389554e35da4f721b2f3c4497eb94a27..d39ba7b4f967851dc30acdde4437a639ceb61439 100644 (file)
@@ -25,7 +25,7 @@
 #include <errno.h>
 
 #include <glibmm.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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<Port> a, boost::shared_ptr<Port> 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<Port> 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<Port> 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> 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<string>::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<Bundle> 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<Bundle> 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<int> r = ConnectingLegal ();
        return r.get_value_or (0);
@@ -1720,6 +1720,6 @@ IO::physically_connected () const
 bool
 IO::has_port (boost::shared_ptr<Port> p) const
 {
-       Glib::Mutex::Lock lm (io_lock);
+       Glib::Threads::Mutex::Lock lm (io_lock);
        return _ports.contains (p);
 }
index e909957e0d9daaf27e1b67cd34504e6fec4f111c..96a289e06f8efadde00b279fd5f1c35c541ed3b0 100644 (file)
@@ -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)) &&
index 5e2a6e23b95dbe3ce8f61f95199465b94ceff3fa..64f02b0ad9c59a520c0d4c973c179d26f7ed4964 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "pbd/error.h"
 #include "pbd/basename.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #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<MidiBuffer> 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;
 }
index a914a0d8873f55942942d93db825c600a9b6737f..e86b229c71585077d209eb6bdea7d80ee8ca47d0 100644 (file)
@@ -1555,7 +1555,7 @@ MidiModel::edit_lock()
        boost::shared_ptr<MidiSource> 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<MidiSource> 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<AutomationList> al = boost::dynamic_pointer_cast<AutomationList> (control(p)->list ());
        al->set_automation_state (s);
 }
index 518413e2de20da3d3eca1a2e919c045701fc5a3b..8509e55f97017a06597897bbdcc92e5615edd4d9 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <set>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #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 ();
 }
 
index 96e7b2b934b451b81cc4c68ce5503a7628c24ed9..92795db4aec202d3f25131d6813c3cf750e16442 100644 (file)
@@ -195,7 +195,7 @@ MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_sta
                        MidiStateTracker* tracker,
                        std::set<Evoral::Parameter> 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<framepos_t>& dst, framepos_t source_sta
 framecnt_t
 MidiSource::midi_write (MidiRingBuffer<framepos_t>& 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);
 
index aa03def614bc60e544aa306e16a235a62e433516..1794d5ff93553cb6e7cbbe16b5575ef202ffb724 100644 (file)
@@ -85,7 +85,7 @@ MidiStretch::run (boost::shared_ptr<Region> r, Progress*)
        boost::shared_ptr<MidiSource> new_src = boost::dynamic_pointer_cast<MidiSource>(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<MidiModel> new_model = new_src->model();
index 800e7949d5a7b5f6694784e4df7739301fc2e427..0f73292c671053dab3038c82e1da7e47f8c9597f 100644 (file)
@@ -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;
index 6c95730f24f6999d050b0ca5b886d5fcece66919..1176c59f256ccc3a977d7dfc186207bb737f227c 100644 (file)
@@ -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);
index f390e190f5b96b9f064fcd317fc71dd5cdb29d58..23cebf427679ec6938a6c7ea37475a58d67da82f 100644 (file)
@@ -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);
index 5d3b54cb13b8c81bf4851f7466fa3cf3f8751c48..e10ccf160ce78e4eb22ee92a681b54b54770ecd4 100644 (file)
@@ -29,20 +29,17 @@ using namespace ARDOUR;
 using namespace Glib;
 using namespace std;
 
-Private<ThreadBuffers>* ProcessThread::_private_thread_buffers = 0;
-
 static void
 release_thread_buffer (void* arg)
 {
         BufferManager::put_thread_buffers ((ThreadBuffers*) arg);
 }
 
+Glib::Threads::Private<ThreadBuffers> ProcessThread::_private_thread_buffers (release_thread_buffer);
+
 void
 ProcessThread::init ()
 {
-       if (_private_thread_buffers == 0) {
-               _private_thread_buffers = new Private<ThreadBuffers> (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;
index 2166741ddad8e3cd7a6319d0c6e22194dd76c536..c74ce4e41998ec82797f64c6c0112e9a6ee5ce01 100644 (file)
@@ -23,7 +23,7 @@
 #include <algorithm>
 #include <sstream>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/xml++.h"
 
 #include "ardour/debug.h"
index ddc0451523c356884442f3c8405d14d4e36aac23..3e815247504ee3cab21387c2a47877853f0054fd 100644 (file)
@@ -36,10 +36,10 @@ using namespace PBD;
 using namespace std;
 
 PBD::Signal1<void,boost::shared_ptr<Region> > 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<std::string, uint32_t>               RegionFactory::region_name_number_map;
 std::map<std::string, PBD::ID>                RegionFactory::region_name_map;
 RegionFactory::CompoundAssociations           RegionFactory::_compound_associations;
@@ -310,7 +310,7 @@ RegionFactory::map_add (boost::shared_ptr<Region> 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<Region> 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> 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> 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<string, PBD::ID>::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> 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<string,uint32_t>::iterator x;
 
@@ -622,7 +622,7 @@ RegionFactory::new_region_name (string old)
 void
 RegionFactory::get_regions_using_source (boost::shared_ptr<Source> s, std::set<boost::shared_ptr<Region> >& 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<Source> s, std::set<b
 void
 RegionFactory::remove_regions_using_source (boost::shared_ptr<Source> 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<Source> src)
 void
 RegionFactory::add_compound_association (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> copy)
 {
-       Glib::Mutex::Lock lm (region_map_lock);
+       Glib::Threads::Mutex::Lock lm (region_map_lock);
        _compound_associations[copy] = orig;
 }
index 43a2e1bfd1e997246d3dfd7299af3cd6227aa7cd..519f3ca494d1c9b7c45b495ca70e10943a296184 100644 (file)
@@ -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);
        }
 
index de4a5832910ab4675e5d2b40d994874864d99bac..a540e0aa93e7612440957c7585013c814516064e 100644 (file)
@@ -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<boost::shared_ptr<Processor> >& p
 boost::shared_ptr<Processor>
 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<Processor> ();
        }
 
-       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> processor, boost::shared_ptr<
        }
 
        {
-               Glib::RWLock::WriterLock lm (_processor_lock);
+               Glib::Threads::RWLock::WriterLock lm (_processor_lock);
                ProcessorState pstate (this);
 
                boost::shared_ptr<PluginInsert> pi;
@@ -1003,7 +1003,7 @@ Route::add_processor (boost::shared_ptr<Processor> 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<Processor>
        }
 
        {
-               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<Processor>
                        }
 
                        {
-                               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<PluginInsert> (*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> 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> 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<pair<ChanCount, ChanCount> >
 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<InternalReturn> d = boost::dynamic_pointer_cast<InternalReturn>(*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<InternalReturn> d = boost::dynamic_pointer_cast<InternalReturn>(*x);
@@ -2697,7 +2697,7 @@ Route::add_aux_send (boost::shared_ptr<Route> route, boost::shared_ptr<Processor
        assert (route != _session.monitor_out ());
 
        {
-               Glib::RWLock::ReaderLock rm (_processor_lock);
+               Glib::Threads::RWLock::ReaderLock rm (_processor_lock);
 
                for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ++x) {
 
@@ -2715,7 +2715,7 @@ Route::add_aux_send (boost::shared_ptr<Route> route, boost::shared_ptr<Processor
                boost::shared_ptr<InternalSend> 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> 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<Evoral::Parameter> parameters = (*i)->what_can_be_automated();
@@ -3463,7 +3463,7 @@ Route::set_name_in_state (XMLNode& node, string const & name)
 boost::shared_ptr<Send>
 Route::internal_send_for (boost::shared_ptr<const Route> 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<InternalSend> 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<AutomationControl>((*i)->control (param))) != 0) {
                                break;
@@ -3624,7 +3624,7 @@ Route::get_control (const Evoral::Parameter& param)
 boost::shared_ptr<Processor>
 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<Processor>
 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<string> 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<UnknownProcessor const> (*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<Processor>
 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<Processor>
 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<PluginInsert>(*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);
index 59667b2fce1de96f416972c6d2c2c091dca0da58..3d7535d5e53ba14a2337be48a5a6ed29c9e1cdb5 100644 (file)
@@ -30,7 +30,7 @@
 #include <unistd.h>
 #include <limits.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
 
@@ -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> 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<Region const> child) const
        RegionFactory::RegionMap::const_iterator i;
        boost::shared_ptr<Region> 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<boost::shared_ptr<Source> > srcs)
        for (list<boost::shared_ptr<Source> >::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> 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<Source> 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<Source> src)
 boost::shared_ptr<Source>
 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> source;
 
@@ -3032,7 +3032,7 @@ Session::source_by_id (const PBD::ID& id)
 boost::shared_ptr<Source>
 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<AudioFileSource> 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<FileSource> fs
@@ -3514,7 +3514,7 @@ Session::graph_reordered ()
 boost::optional<framecnt_t>
 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<framecnt_t> ();
@@ -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);
         }
index 88f61335e0e18861821a9441a7b705d16f306e58..1d235b051aad98888c70b9b35a15c59a2893ac1e 100644 (file)
@@ -25,7 +25,7 @@
 #include <fcntl.h>
 #include <poll.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/error.h"
 #include "pbd/pthread_utils.h"
index abfbaecfcd69f03b5da7e9ded5ad2df007722f60..e6e8749aec8c4c34367ec17f8555576e54d27b34 100644 (file)
@@ -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;
index acb23aee8b42cc4d3164cd6930379eec01ebe9d5..1c1b4f9a0f1acd7831c3b6fd1f060c26c5f9afb6 100644 (file)
@@ -19,7 +19,7 @@
 
 
 #include "pbd/error.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include <midi++/manager.h>
 #include <midi++/mmc.h>
index b833aea1f29df5af5c8436fedf0383e75c150361..ac3baf20081ae3f9faf0a1fd70af2689a68a52be 100644 (file)
@@ -69,7 +69,7 @@ SessionPlaylists::~SessionPlaylists ()
 bool
 SessionPlaylists::add (boost::shared_ptr<Playlist> 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> playlist)
 void
 SessionPlaylists::remove (boost::shared_ptr<Playlist> 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<Playlist> 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<Playlist> wpl)
 uint32_t
 SessionPlaylists::n_playlists () const
 {
-       Glib::Mutex::Lock lm (lock);
+       Glib::Threads::Mutex::Lock lm (lock);
        return playlists.size();
 }
 
 boost::shared_ptr<Playlist>
 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<Playlist>
 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<boost::shared_ptr<Playlist> > & 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<boost::shared_ptr<Playlist> > & list)
 void
 SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& 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<boost::shared_ptr<Playlist> >& s) const
 void
 SessionPlaylists::destroy_region (boost::shared_ptr<Region> 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<const Source> 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<Crossfade>
 SessionPlaylists::find_crossfade (const PBD::ID& id)
 {
-       Glib::Mutex::Lock lm (lock);
+       Glib::Threads::Mutex::Lock lm (lock);
 
        boost::shared_ptr<Crossfade> c;
 
@@ -435,7 +435,7 @@ SessionPlaylists::find_crossfade (const PBD::ID& id)
 uint32_t
 SessionPlaylists::region_use_count (boost::shared_ptr<Region> 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) {
index 6cebc13b0d4bc36cdb94b87272a025fcae99f177..019f491a4a08a30ba9abdea04106f775dba61664 100644 (file)
@@ -25,7 +25,7 @@
 #include "pbd/error.h"
 #include "pbd/enumwriter.h"
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/audioengine.h"
 #include "ardour/auditioner.h"
index 6661d33c9ac5aacc2fb1867d76899a1c0c21b898..3ef2e0d521771878f3d129701eed2c328c43251f 100644 (file)
@@ -54,7 +54,7 @@
 #include <glib/gstdio.h>
 
 #include <glibmm.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include <boost/algorithm/string.hpp>
 
@@ -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<Region> 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<Controllable> 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<Controllable>(c, null_deleter()));
 
@@ -3028,7 +3028,7 @@ Session::remove_controllable (Controllable* c)
 boost::shared_ptr<Controllable>
 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 ());
index 795a106685b5abafb14f9645c12fcb03e1c572bb..7502ded28851e0a2d152d6179823852b2af9b570 100644 (file)
@@ -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()) {
 
index 368982f10dceb773ffaff857e7912f6e6944b38a..47c653a698a6fb1f9a688818fe02800eb4f048e9 100644 (file)
@@ -427,7 +427,7 @@ SMFSource::mark_streaming_write_completed ()
 void
 SMFSource::mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::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<Glib::Mutex::Lock> lm;
+       boost::shared_ptr<Glib::Threads::Mutex::Lock> lm;
        if (lock)
-               lm = boost::shared_ptr<Glib::Mutex::Lock>(new Glib::Mutex::Lock(_lock));
+               lm = boost::shared_ptr<Glib::Threads::Mutex::Lock>(new Glib::Threads::Mutex::Lock(_lock));
 
        if (_model && !force_reload) {
                return;
index e9e3b0014216401193dc6f64aa56761504f5d029..618dddc70b75808e63550b53a42b1fb945cb5d7b 100644 (file)
@@ -29,7 +29,7 @@
 #include <algorithm>
 #include <fstream>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
 #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
 }
 
index b0803a9d34cbf9d55f2f9cedc8fd0f5ddfb90f99..da5980599d989f3530224de70d47b10ba4e967ef 100644 (file)
@@ -50,8 +50,8 @@ using namespace std;
 using namespace PBD;
 
 PBD::Signal1<void,boost::shared_ptr<Source> > 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<boost::weak_ptr<AudioSource> > 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<Source> 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<AudioSource> (as));
-                       PeaksToBuild->broadcast ();
+                       PeaksToBuild.broadcast ();
 
                } else {
 
index f96bb5a91aaf33bb632760e55f2c0faf8c44a6d0..a5016073bb000eea606bced570ab0a9cd1aec45f 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <unistd.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #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<TempoSection*> (*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);
index 452a0843e28f06d6189f2f7e9d9e487163d29e0d..92e51a42504090592646d03f7606f2c4630c18d7 100644 (file)
@@ -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<Amp> (*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<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i);
                        if (iop) {
index de71a87d86b262943ad2ac9fe793247020a08570..2655d6bc7d817d516e78aa832a1eddf6515be304 100644 (file)
@@ -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<Channel>::iterator i = _channel.begin(); i != _channel.end(); ++i) {
                        XMLNode* c = new XMLNode ("Channel");
index c108f653c43edf916a75d6da0d9456fdaf8f5c66..290689f13cf0e8b812521a8518a17521841eabb0 100644 (file)
@@ -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<uint8_t>(ring_size))
        , _responses(new RingBuffer<uint8_t>(ring_size))
        , _response((uint8_t*)malloc(ring_size))
index 0f4aaff973fffe3bc1ada93d9381e71fdbefaf7d..d1e11c00e1201e865ea7e01e9dab273f6115abeb 100644 (file)
@@ -2,6 +2,7 @@
 #define AUDIOGRAPHER_THREADER_H
 
 #include <glibmm/threadpool.h>
+#include <glibmm/timeval.h>
 #include <sigc++/slot.h>
 #include <boost/format.hpp>
 
@@ -86,11 +87,8 @@ class Threader : public Source<T>, public Sink<T>
        void wait()
        {
                while (g_atomic_int_get (&readers) != 0) {
-                       Glib::TimeVal wait_time;
-                       wait_time.assign_current_time();
-                       wait_time.add_milliseconds(wait_timeout);
-               
-                       wait_cond.timed_wait(wait_mutex, wait_time);
+                       gint64 end_time = g_get_monotonic_time () + (wait_timeout * G_TIME_SPAN_MILLISECOND);
+                       wait_cond.wait_until(wait_mutex, end_time);
                }
 
                wait_mutex.unlock();
@@ -119,12 +117,12 @@ class Threader : public Source<T>, public Sink<T>
        OutputVec outputs;
 
        Glib::ThreadPool & thread_pool;
-       Glib::Mutex wait_mutex;
-       Glib::Cond  wait_cond;
+        Glib::Threads::Mutex wait_mutex;
+        Glib::Threads::Cond  wait_cond;
        gint        readers;
        long        wait_timeout;
        
-       Glib::Mutex exception_mutex;
+        Glib::Threads::Mutex exception_mutex;
        boost::shared_ptr<ThreaderException> exception;
 
 };
index 6fed393dc851b7caab1c776266f09ba111434bad..756a45fd42c10355fb86ed026c1adef12aefe88c 100644 (file)
@@ -1,8 +1,6 @@
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
 
-#include <glibmm/thread.h>
-
 int main()
 {
        Glib::thread_init();
index 74d4e5b982a2490b4bc5d869b7a05940af1d1b97..ffddd9d6e579c83cc451b7b19184fe65557806ba 100644 (file)
@@ -23,7 +23,7 @@
 #include <list>
 #include <boost/pool/pool.hpp>
 #include <boost/pool/pool_alloc.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/signals.h"
 #include "evoral/types.hpp"
 #include "evoral/Range.hpp"
@@ -107,7 +107,7 @@ public:
 
        EventList::size_type size() const { return _events.size(); }
         double length() const {                
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                return _events.empty() ? 0.0 : _events.back()->when;
        }
        bool empty() const { return _events.empty(); }
@@ -165,18 +165,18 @@ public:
        std::pair<ControlList::iterator,ControlList::iterator> control_points_adjacent (double when);
 
        template<class T> void apply_to_points (T& obj, void (T::*method)(const ControlList&)) {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                (obj.*method)(*this);
        }
 
        double eval (double where) {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                return unlocked_eval (where);
        }
 
        double rt_safe_eval (double where, bool& ok) {
 
-               Glib::Mutex::Lock lm (_lock, Glib::TRY_LOCK);
+               Glib::Threads::Mutex::Lock lm (_lock, Glib::Threads::TRY_LOCK);
 
                if ((ok = lm.locked())) {
                        return unlocked_eval (where);
@@ -207,7 +207,7 @@ public:
        double default_value() const { return _parameter.normal(); }
 
        // FIXME: const violations for Curve
-       Glib::Mutex& lock()         const { return _lock; }
+       Glib::Threads::Mutex& lock()         const { return _lock; }
        LookupCache& lookup_cache() const { return _lookup_cache; }
        SearchCache& search_cache() const { return _search_cache; }
 
@@ -280,7 +280,7 @@ protected:
        Parameter             _parameter;
        InterpolationStyle    _interpolation;
        EventList             _events;
-       mutable Glib::Mutex   _lock;
+       mutable Glib::Threads::Mutex   _lock;
        int8_t                _frozen;
        bool                  _changed_when_thawed;
        double                _min_yval;
index 8df942b31fdb6b7f79fd31650e5dace455f14725..431885112b1d6c6ac22f82822751c0d88e26ef3b 100644 (file)
@@ -23,7 +23,7 @@
 #include <map>
 #include <boost/shared_ptr.hpp>
 #include <boost/utility.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/signals.h"
 #include "evoral/types.hpp"
 #include "evoral/Parameter.hpp"
@@ -65,13 +65,13 @@ public:
 
        void what_has_data(std::set<Parameter>&) const;
 
-       Glib::Mutex& control_lock() const { return _control_lock; }
+       Glib::Threads::Mutex& control_lock() const { return _control_lock; }
 
 protected:
        virtual void control_list_marked_dirty () {}
        virtual void control_list_interpolation_changed (Parameter, ControlList::InterpolationStyle) {}
 
-       mutable Glib::Mutex _control_lock;
+       mutable Glib::Threads::Mutex _control_lock;
        Controls            _controls;
 
        PBD::ScopedConnectionList _list_connections;
index ab3e3bd41bf0fe11473b6c32f014aec0d0531ea6..cb851cf2f60434f1a249702357eac6466d5da304 100644 (file)
@@ -25,7 +25,7 @@
 #include <list>
 #include <utility>
 #include <boost/shared_ptr.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "evoral/types.hpp"
 #include "evoral/Note.hpp"
 #include "evoral/Parameter.hpp"
@@ -67,16 +67,16 @@ public:
 
 protected:
        struct WriteLockImpl {
-               WriteLockImpl(Glib::RWLock& s, Glib::Mutex& c)
-                       : sequence_lock(new Glib::RWLock::WriterLock(s))
-                       , control_lock(new Glib::Mutex::Lock(c))
+               WriteLockImpl(Glib::Threads::RWLock& s, Glib::Threads::Mutex& c)
+                       : sequence_lock(new Glib::Threads::RWLock::WriterLock(s))
+                       , control_lock(new Glib::Threads::Mutex::Lock(c))
                { }
                ~WriteLockImpl() {
                        delete sequence_lock;
                        delete control_lock;
                }
-               Glib::RWLock::WriterLock* sequence_lock;
-               Glib::Mutex::Lock*        control_lock;
+               Glib::Threads::RWLock::WriterLock* sequence_lock;
+               Glib::Threads::Mutex::Lock*        control_lock;
        };
 
 public:
@@ -84,10 +84,10 @@ public:
        typedef typename boost::shared_ptr<Evoral::Note<Time> >  NotePtr;
        typedef typename boost::shared_ptr<const Evoral::Note<Time> >  constNotePtr;
 
-       typedef boost::shared_ptr<Glib::RWLock::ReaderLock> ReadLock;
+       typedef boost::shared_ptr<Glib::Threads::RWLock::ReaderLock> ReadLock;
        typedef boost::shared_ptr<WriteLockImpl>            WriteLock;
 
-       virtual ReadLock  read_lock() const { return ReadLock(new Glib::RWLock::ReaderLock(_lock)); }
+       virtual ReadLock  read_lock() const { return ReadLock(new Glib::Threads::RWLock::ReaderLock(_lock)); }
        virtual WriteLock write_lock()      { return WriteLock(new WriteLockImpl(_lock, _control_lock)); }
 
        void clear();
@@ -287,7 +287,7 @@ protected:
        bool                   _edited;
        bool                   _overlapping_pitches_accepted;
        OverlapPitchResolution _overlap_pitch_resolution;
-       mutable Glib::RWLock   _lock;
+       mutable Glib::Threads::RWLock   _lock;
        bool                   _writing;
 
        virtual int resolve_overlaps_unlocked (const NotePtr, void* /* arg */ = 0) {
index f25f988ec0d032f372558614b8a1a30e3b33e771..c4495485de7d84fc896902f776124f0ff3bcb753 100644 (file)
@@ -168,7 +168,7 @@ void
 ControlList::copy_events (const ControlList& other)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                _events.clear ();
                for (const_iterator i = other.begin(); i != other.end(); ++i) {
                        _events.push_back (new ControlEvent ((*i)->when, (*i)->value));
@@ -206,7 +206,7 @@ void
 ControlList::clear ()
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                _events.clear ();
                unlocked_invalidate_insert_iterator ();
                mark_dirty ();
@@ -218,14 +218,14 @@ ControlList::clear ()
 void
 ControlList::x_scale (double factor)
 {
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
        _x_scale (factor);
 }
 
 bool
 ControlList::extend_to (double when)
 {
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
        if (_events.empty() || _events.back()->when == when) {
                return false;
        }
@@ -256,7 +256,7 @@ void
 ControlList::merge_nascent (double when)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                if (nascent.empty()) {
                        return;
@@ -449,7 +449,7 @@ ControlList::thin ()
        bool changed = false;
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                
                ControlEvent* prevprev = 0;
                ControlEvent* cur = 0;
@@ -509,7 +509,7 @@ ControlList::thin ()
 void
 ControlList::fast_simple_add (double when, double value)
 {
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
        /* to be used only for loading pre-sorted data from saved state */
        _events.insert (_events.end(), new ControlEvent (when, value));
        assert(_events.back());
@@ -520,7 +520,7 @@ ControlList::fast_simple_add (double when, double value)
 void
 ControlList::invalidate_insert_iterator ()
 {
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
        unlocked_invalidate_insert_iterator ();
 }
 
@@ -533,7 +533,7 @@ ControlList::unlocked_invalidate_insert_iterator ()
 void
 ControlList::start_write_pass (double when)
 {
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
 
        new_write_pass = true;
        did_write_during_pass = false;
@@ -585,7 +585,7 @@ ControlList::add (double when, double value)
                                                         this, value, when, _in_write_pass, (most_recent_insert_iterator == _events.end())));
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                ControlEvent cp (when, 0.0f);
                iterator insertion_point;
 
@@ -847,7 +847,7 @@ void
 ControlList::erase (iterator i)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                if (most_recent_insert_iterator == i) {
                        unlocked_invalidate_insert_iterator ();
                }
@@ -861,7 +861,7 @@ void
 ControlList::erase (iterator start, iterator end)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                _events.erase (start, end);
                unlocked_invalidate_insert_iterator ();
                mark_dirty ();
@@ -874,7 +874,7 @@ void
 ControlList::erase (double when, double value)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                iterator i = begin ();
                while (i != end() && ((*i)->when != when || (*i)->value != value)) {
@@ -900,7 +900,7 @@ ControlList::erase_range (double start, double endt)
        bool erased = false;
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                erased = erase_range_internal (start, endt, _events);
 
                if (erased) {
@@ -939,7 +939,7 @@ void
 ControlList::slide (iterator before, double distance)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                if (before == _events.end()) {
                        return;
@@ -960,7 +960,7 @@ void
 ControlList::shift (double pos, double frames)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                for (iterator i = _events.begin(); i != _events.end(); ++i) {
                        if ((*i)->when >= pos) {
@@ -983,7 +983,7 @@ ControlList::modify (iterator iter, double when, double val)
        */
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                (*iter)->when = when;
                (*iter)->value = val;
@@ -1008,7 +1008,7 @@ ControlList::modify (iterator iter, double when, double val)
 std::pair<ControlList::iterator,ControlList::iterator>
 ControlList::control_points_adjacent (double xval)
 {
-       Glib::Mutex::Lock lm (_lock);
+       Glib::Threads::Mutex::Lock lm (_lock);
        iterator i;
        ControlEvent cp (xval, 0.0f);
        std::pair<iterator,iterator> ret;
@@ -1054,7 +1054,7 @@ ControlList::thaw ()
        }
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                if (_sort_pending) {
                        _events.sort (event_time_less_than);
@@ -1081,7 +1081,7 @@ void
 ControlList::truncate_end (double last_coordinate)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                ControlEvent cp (last_coordinate, 0);
                ControlList::reverse_iterator i;
                double last_val;
@@ -1184,7 +1184,7 @@ void
 ControlList::truncate_start (double overall_length)
 {
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                iterator i;
                double first_legal_value;
                double first_legal_coordinate;
@@ -1439,7 +1439,7 @@ bool
 ControlList::rt_safe_earliest_event (double start, double& x, double& y, bool inclusive) const
 {
        // FIXME: It would be nice if this was unnecessary..
-       Glib::Mutex::Lock lm(_lock, Glib::TRY_LOCK);
+       Glib::Threads::Mutex::Lock lm(_lock, Glib::Threads::TRY_LOCK);
        if (!lm.locked()) {
                return false;
        }
@@ -1638,7 +1638,7 @@ ControlList::cut_copy_clear (double start, double end, int op)
        ControlEvent cp (start, 0.0);
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                /* first, determine s & e, two iterators that define the range of points
                   affected by this operation
@@ -1754,7 +1754,7 @@ ControlList::paste (ControlList& alist, double pos, float /*times*/)
        }
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                iterator where;
                iterator prev;
                double end = 0;
@@ -1802,7 +1802,7 @@ ControlList::move_ranges (const list< RangeMove<double> >& movements)
        typedef list< RangeMove<double> > RangeMoveList;
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                /* a copy of the events list before we started moving stuff around */
                EventList old_events = _events;
index d4480c2897859d048eb3d014ef68c16ba0ffe038..393b819146932f6187bd5e28a85825da3fef6b79 100644 (file)
@@ -53,7 +53,7 @@ ControlSet::add_control(boost::shared_ptr<Control> ac)
 void
 ControlSet::what_has_data (set<Parameter>& s) const
 {
-       Glib::Mutex::Lock lm (_control_lock);
+       Glib::Threads::Mutex::Lock lm (_control_lock);
 
        for (Controls::const_iterator li = _controls.begin(); li != _controls.end(); ++li) {
                if (li->second->list() && !li->second->list()->empty()) {
@@ -116,7 +116,7 @@ ControlSet::find_next_event (double now, double end, ControlEvent& next_event) c
 void
 ControlSet::clear_controls ()
 {
-       Glib::Mutex::Lock lm (_control_lock);
+       Glib::Threads::Mutex::Lock lm (_control_lock);
 
        _control_connections.drop_connections ();
        _list_connections.drop_connections ();
index 81faee70d3148171b14a3f2ac6626a565ae38896..3f2ee361d328de0a53980a40ed34e6749c0571f4 100644 (file)
@@ -23,7 +23,7 @@
 #include <cfloat>
 #include <cmath>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "evoral/Curve.hpp"
 #include "evoral/ControlList.hpp"
@@ -170,7 +170,7 @@ Curve::solve ()
 bool
 Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen)
 {
-       Glib::Mutex::Lock lm(_list.lock(), Glib::TRY_LOCK);
+       Glib::Threads::Mutex::Lock lm(_list.lock(), Glib::Threads::TRY_LOCK);
 
        if (!lm.locked()) {
                return false;
@@ -183,7 +183,7 @@ Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen)
 void
 Curve::get_vector (double x0, double x1, float *vec, int32_t veclen)
 {
-       Glib::Mutex::Lock lm(_list.lock());
+       Glib::Threads::Mutex::Lock lm(_list.lock());
        _get_vector (x0, x1, vec, veclen);
 }
 
index 11b06b78ffe4595fbb9e4cf1102d252e56e20bab..a1b932af59543bf412349510a0c50032b95fe0b5 100644 (file)
@@ -82,7 +82,7 @@ UI::UI (string namestr, int *argc, char ***argv)
           which is assumed to have called this.
        */
 
-       run_loop_thread = Thread::self();
+       run_loop_thread = Threads::Thread::self();
        
        /* store "this" as the UI-for-thread of this thread, same argument
           as for previous line.
@@ -124,7 +124,7 @@ UI::~UI ()
 bool
 UI::caller_is_ui_thread ()
 {
-       return Thread::self() == run_loop_thread;
+       return Threads::Thread::self() == run_loop_thread;
 }
 
 int
index 4bf82fb1aa034cc7063af3728fc440c9b259f3e3..40137bbbb7a719effd331bf67aca400e086c1b0c 100644 (file)
@@ -117,8 +117,6 @@ class UI : public AbstractUI<UIRequest>
 
        bool caller_is_ui_thread ();
 
-       static Glib::Thread* thread_id() { return gui_thread; }
-
        /* Gtk-UI specific interfaces */
 
        bool running ();
@@ -161,8 +159,6 @@ class UI : public AbstractUI<UIRequest>
 
        static bool just_hide_it (GdkEventAny *, Gtk::Window *);
 
-       static Glib::Thread* the_gui_thread() { return gui_thread; }
-
   protected:
        virtual void handle_fatal (const char *);
        virtual void display_message (const char *prefix, gint prefix_len,
@@ -171,7 +167,7 @@ class UI : public AbstractUI<UIRequest>
 
   private:
        static UI *theGtkUI;
-       static Glib::Thread* gui_thread;
+
        bool _active;
        Gtk::Main *theMain;
 #ifndef GTK_NEW_TOOLTIP_API
index 7e30752c38d369bbd5445088c1bc2fe5fdb2a575..c90a3dbe6fd133a2200c21cf4ce38fd9e92ed2e6 100644 (file)
@@ -249,7 +249,7 @@ int
 IPMIDIPort::write (const byte* msg, size_t msglen, timestamp_t /* ignored */) {
 
        if (sockout) {
-               Glib::Mutex::Lock lm (write_lock);
+               Glib::Threads::Mutex::Lock lm (write_lock);
                if (::sendto (sockout, (const char *) msg, msglen, 0, (struct sockaddr *) &addrout, sizeof(struct sockaddr_in)) < 0) {
                        ::perror("sendto");
                        return -1;
index 9d7fb8c70ee5051476dccc2e78b7300f459593b1..10274ad859550b97c221c6e8d53c27e14d81294a 100644 (file)
@@ -220,7 +220,7 @@ JackMIDIPort::write (const byte * msg, size_t msglen, timestamp_t timestamp)
        
        if (!is_process_thread()) {
 
-               Glib::Mutex::Lock lm (output_fifo_lock);
+               Glib::Threads::Mutex::Lock lm (output_fifo_lock);
                RingBuffer< Evoral::Event<double> >::rw_vector vec = { { 0, 0 }, { 0, 0} };
                
                output_fifo.get_write_vector (&vec);
index 32cf1163e6ffdddb82a43428e2da8f707e1a5e72..ff1691baab6d400f6709912f3265761ac2d1bbba 100644 (file)
@@ -28,7 +28,7 @@
 #include <net/if.h>
 #endif
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include <jack/types.h>
 
@@ -63,7 +63,7 @@ private:
     int sockin;
     int sockout;
     struct sockaddr_in addrout;
-    Glib::Mutex write_lock;    
+    Glib::Threads::Mutex write_lock;    
 
     bool open_sockets (int base_port, const std::string& ifname);
     void close_sockets ();
index b8d208c77a4118e923b2a665a658d6c35f54cba4..a8859387a4be77aae3dc7db2d3621143013ca75f 100644 (file)
@@ -79,7 +79,7 @@ private:
        timestamp_t       _last_write_timestamp;
        RingBuffer< Evoral::Event<double> > output_fifo;
        Evoral::EventRingBuffer<timestamp_t> input_fifo;
-       Glib::Mutex output_fifo_lock;
+        Glib::Threads::Mutex output_fifo_lock;
        CrossThreadChannel xthread;
 
        int create_port ();
index 14a3ef644d308b707221f8799ed57e8a52c17d04..a7e148c839867cba0189508fd3631360cb3a265e 100644 (file)
@@ -83,7 +83,7 @@ BaseUI::main_thread ()
 bool
 BaseUI::signal_running ()
 {
-       Glib::Mutex::Lock lm (_run_lock);
+       Glib::Threads::Mutex::Lock lm (_run_lock);
        _running.signal ();
        
        return false; // don't call it again
@@ -101,8 +101,8 @@ BaseUI::run ()
        /* glibmm hack - drop the refptr to the IOSource now before it can hurt */
        request_channel.drop_ios ();
 
-       Glib::Mutex::Lock lm (_run_lock);
-       run_loop_thread = Thread::create (mem_fun (*this, &BaseUI::main_thread), true);
+       Glib::Threads::Mutex::Lock lm (_run_lock);
+       run_loop_thread = Glib::Threads::Thread::create (mem_fun (*this, &BaseUI::main_thread));
        _running.wait (_run_lock);
 }
 
index 3ddbc88e6d9e55cb7cb44e2160dd990d7eb7f74a..26c8188bdeb2356a594cb69115c3c6ac73ff2a00 100644 (file)
@@ -29,7 +29,7 @@
 #include <map>
 #include <set>
 #include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/shared_ptr.hpp>
 
 #include "pbd/stacktrace.h"
@@ -135,10 +135,10 @@ IPointerMap& interesting_pointers() {
         return *_interesting_pointers;
 }
 
-static Glib::Mutex* _the_lock;
-static Glib::Mutex& the_lock() {
+static Glib::Threads::Mutex* _the_lock;
+static Glib::Threads::Mutex& the_lock() {
         if (_the_lock == 0) {
-                _the_lock = new Glib::Mutex;
+                _the_lock = new Glib::Threads::Mutex;
         }
         return *_the_lock;
 }
@@ -167,7 +167,7 @@ boost_debug_shared_ptr_show_live_debugging (bool yn)
 void
 boost_debug_shared_ptr_mark_interesting (void* ptr, const char* type)
 {
-       Glib::Mutex::Lock guard (the_lock());
+       Glib::Threads::Mutex::Lock guard (the_lock());
        pair<void*,const char*> newpair (ptr, type);
        interesting_pointers().insert (newpair);
        if (debug_out) {
@@ -182,7 +182,7 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int
                return;
        }
 
-       Glib::Mutex::Lock guard (the_lock());
+       Glib::Threads::Mutex::Lock guard (the_lock());
 
        if (is_interesting_object  (old_obj) || is_interesting_object (obj)) {
                if (debug_out) {
@@ -230,7 +230,7 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c
                return;
        }
 
-       Glib::Mutex::Lock guard (the_lock());
+       Glib::Threads::Mutex::Lock guard (the_lock());
 
        if (is_interesting_object  (old_obj) || is_interesting_object (obj)) {
                if (debug_out) {
@@ -274,7 +274,7 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c
 void
 boost_debug_shared_ptr_destructor (void const *sp, void const *obj, int use_count)
 {
-       Glib::Mutex::Lock guard (the_lock());
+       Glib::Threads::Mutex::Lock guard (the_lock());
        PointerMap::iterator x = sptrs().find (sp);
 
        if (x != sptrs().end()) {
@@ -289,7 +289,7 @@ void
 boost_debug_shared_ptr_constructor (void const *sp, void const *obj, int use_count)
 {
        if (is_interesting_object (obj)) {
-               Glib::Mutex::Lock guard (the_lock());
+               Glib::Threads::Mutex::Lock guard (the_lock());
                pair<void const*, SPDebug*> newpair;
 
                newpair.first = sp;
@@ -306,14 +306,14 @@ boost_debug_shared_ptr_constructor (void const *sp, void const *obj, int use_cou
 void
 boost_debug_count_ptrs ()
 {
-       Glib::Mutex::Lock guard (the_lock());
+       Glib::Threads::Mutex::Lock guard (the_lock());
        // cerr << "Tracking " << interesting_pointers().size() << " interesting objects with " << sptrs().size () << " shared ptrs\n";
 }
 
 void
 boost_debug_list_ptrs ()
 {
-       Glib::Mutex::Lock guard (the_lock());
+       Glib::Threads::Mutex::Lock guard (the_lock());
 
        if (sptrs().empty()) {
                cerr << "There are no dangling shared ptrs\n";
index 82a8464c8ba64f4d162d9ecc686408034d29910e..42e015ac6f90a6d179841ba25cd96a42d7f3ad52 100644 (file)
@@ -34,7 +34,7 @@ PBD::Signal1<void,Controllable*> Controllable::StopLearning;
 PBD::Signal3<void,Controllable*,int,int> Controllable::CreateBinding;
 PBD::Signal1<void,Controllable*> Controllable::DeleteBinding;
 
-Glib::StaticRWLock Controllable::registry_lock = GLIBMM_STATIC_RW_LOCK_INIT;
+Glib::Threads::RWLock Controllable::registry_lock;
 Controllable::Controllables Controllable::registry;
 PBD::ScopedConnectionList* registry_connections = 0;
 const std::string Controllable::xml_node_name = X_("Controllable");
@@ -52,7 +52,7 @@ Controllable::add (Controllable& ctl)
 {
        using namespace boost;
 
-       Glib::RWLock::WriterLock lm (registry_lock);
+       Glib::Threads::RWLock::WriterLock lm (registry_lock);
        registry.insert (&ctl);
 
        if (!registry_connections) {
@@ -67,7 +67,7 @@ Controllable::add (Controllable& ctl)
 void
 Controllable::remove (Controllable* ctl)
 {
-       Glib::RWLock::WriterLock lm (registry_lock);
+       Glib::Threads::RWLock::WriterLock lm (registry_lock);
 
        for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
                if ((*i) == ctl) {
@@ -80,7 +80,7 @@ Controllable::remove (Controllable* ctl)
 Controllable*
 Controllable::by_id (const ID& id)
 {
-       Glib::RWLock::ReaderLock lm (registry_lock);
+       Glib::Threads::RWLock::ReaderLock lm (registry_lock);
 
        for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
                if ((*i)->id() == id) {
@@ -93,7 +93,7 @@ Controllable::by_id (const ID& id)
 Controllable*
 Controllable::by_name (const string& str)
 {
-       Glib::RWLock::ReaderLock lm (registry_lock);
+       Glib::Threads::RWLock::ReaderLock lm (registry_lock);
 
        for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
                if ((*i)->_name == str) {
index 6950c045ff0fba82e6232bcaa08e73b07d25cc56..77b08b9f73a254470d8efb10f8910c3ee1f2168f 100644 (file)
@@ -4,10 +4,10 @@
 using namespace PBD;
 using namespace std;
 
-Glib::StaticPrivate<EventLoop> EventLoop::thread_event_loop;
-
 static void do_not_delete_the_loop_pointer (void*) { }
 
+Glib::Threads::Private<EventLoop> EventLoop::thread_event_loop (do_not_delete_the_loop_pointer); 
+
 EventLoop* 
 EventLoop::get_event_loop_for_thread() {
        return thread_event_loop.get ();
@@ -16,7 +16,7 @@ EventLoop::get_event_loop_for_thread() {
 void 
 EventLoop::set_event_loop_for_thread (EventLoop* loop) 
 {
-       thread_event_loop.set (loop, do_not_delete_the_loop_pointer); 
+       thread_event_loop.set (loop);
 }
 
 void* 
@@ -49,7 +49,7 @@ EventLoop::invalidate_request (void* data)
         */
        
         if (ir->event_loop) {
-               Glib::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
+               Glib::Threads::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
                for (list<BaseRequestObject*>::iterator i = ir->requests.begin(); i != ir->requests.end(); ++i) {
                        (*i)->valid = false;
                        (*i)->invalidation = 0;
index 29ef7d6e6ee6245bc72b99b97b551ebcd02e6adf..a71ffca190259be5c24c66706d95bd6da7694e19 100644 (file)
@@ -57,7 +57,7 @@ FileManager::FileManager ()
 void
 FileManager::add (FileDescriptor* d)
 {
-       Glib::Mutex::Lock lm (_mutex);
+       Glib::Threads::Mutex::Lock lm (_mutex);
        _files.push_back (d);
 }
 
@@ -65,7 +65,7 @@ FileManager::add (FileDescriptor* d)
 bool
 FileManager::allocate (FileDescriptor* d)
 {
-       Glib::Mutex::Lock lm (_mutex);
+       Glib::Threads::Mutex::Lock lm (_mutex);
 
        if (!d->is_open()) {
                
@@ -131,7 +131,7 @@ FileManager::allocate (FileDescriptor* d)
 void
 FileManager::release (FileDescriptor* d)
 {
-       Glib::Mutex::Lock lm (_mutex);
+       Glib::Threads::Mutex::Lock lm (_mutex);
 
        d->_refcount--;
        assert (d->_refcount >= 0);
@@ -141,7 +141,7 @@ FileManager::release (FileDescriptor* d)
 void
 FileManager::remove (FileDescriptor* d)
 {
-       Glib::Mutex::Lock lm (_mutex);
+       Glib::Threads::Mutex::Lock lm (_mutex);
 
        if (d->is_open ()) {
                close (d);
index 9b04c88e656a83e55396af656ffcb05bbf82878d..24cf02ab2ea6f2a0d9591355cb04e2d452a969d4 100644 (file)
 using namespace std;
 using namespace PBD;
 
-Glib::Mutex* ID::counter_lock = 0;
+Glib::Threads::Mutex* ID::counter_lock = 0;
 uint64_t ID::_counter = 0;
 
 void
 ID::init ()
 {
        if (!counter_lock)
-               counter_lock = new Glib::Mutex;
+               counter_lock = new Glib::Threads::Mutex;
 }
 
 ID::ID ()
@@ -59,7 +59,7 @@ ID::ID (string str)
 void
 ID::reset ()
 {
-       Glib::Mutex::Lock lm (*counter_lock);
+       Glib::Threads::Mutex::Lock lm (*counter_lock);
        _id = _counter++;
 }      
 
index b300a62dd8e780e0d260e2750c1f2a7a64f1b5d1..8ebc12a43397360d06f74186121c14cf3737b4d2 100644 (file)
@@ -11,9 +11,6 @@
 
 using namespace std;
 
-template<typename R>
-Glib::StaticPrivate<typename AbstractUI<R>::RequestBuffer> AbstractUI<R>::per_thread_request_buffer;
-
 template<typename RequestBuffer> void 
 cleanup_request_buffer (void* ptr)
 {
@@ -28,11 +25,14 @@ cleanup_request_buffer (void* ptr)
         
 
         {
-                Glib::Mutex::Lock lm (rb->ui.request_buffer_map_lock);
+                Glib::Threads::Mutex::Lock lm (rb->ui.request_buffer_map_lock);
                 rb->dead = true;
         }
 }
 
+template<typename R>
+Glib::Threads::Private<typename AbstractUI<R>::RequestBuffer> AbstractUI<R>::per_thread_request_buffer (cleanup_request_buffer<AbstractUI<R>::RequestBuffer>);
+
 template <typename RequestObject>
 AbstractUI<RequestObject>::AbstractUI (const string& name)
        : BaseUI (name)
@@ -87,7 +87,7 @@ AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_
                   only at thread initialization time, not repeatedly, 
                   and so this is of little consequence.
                */
-               Glib::Mutex::Lock lm (request_buffer_map_lock);
+               Glib::Threads::Mutex::Lock lm (request_buffer_map_lock);
                request_buffers[thread_id] = b;
        }
 
@@ -100,7 +100,7 @@ AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_
           dead. it will then be deleted during a call to handle_ui_requests()
        */
        
-       per_thread_request_buffer.set (b, cleanup_request_buffer<RequestBuffer>);
+       per_thread_request_buffer.set (b);
 }
 
 template <typename RequestObject> RequestObject*
@@ -209,7 +209,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
 
        /* and now, the generic request buffer. same rules as above apply */
 
-       Glib::Mutex::Lock lm (request_list_lock);
+       Glib::Threads::Mutex::Lock lm (request_list_lock);
 
        while (!request_list.empty()) {
                RequestObject* req = request_list.front ();
@@ -322,7 +322,7 @@ AbstractUI<RequestObject>::send_request (RequestObject *req)
                           single-reader/single-writer semantics
                        */
                        DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 send heap request type %3\n", name(), pthread_self(), req->type));
-                       Glib::Mutex::Lock lm (request_list_lock);
+                       Glib::Threads::Mutex::Lock lm (request_list_lock);
                        request_list.push_back (req);
                }
 
index 7eb23202308ad97bc8cb9d98a8d01b7c5d1d65be..fb09dee5c26a0b1721491378c2b18861e27799ca 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <pthread.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/receiver.h"
 #include "pbd/ringbufferNPT.h"
@@ -42,9 +42,9 @@ class AbstractUI : public BaseUI
 
        void register_thread (std::string, pthread_t, std::string, uint32_t num_requests);
        void call_slot (EventLoop::InvalidationRecord*, const boost::function<void()>&);
-        Glib::Mutex& slot_invalidation_mutex() { return request_buffer_map_lock; }
+        Glib::Threads::Mutex& slot_invalidation_mutex() { return request_buffer_map_lock; }
 
-       Glib::Mutex request_buffer_map_lock;
+       Glib::Threads::Mutex request_buffer_map_lock;
 
   protected:
        struct RequestBuffer : public PBD::RingBufferNPT<RequestObject> {
@@ -60,9 +60,9 @@ class AbstractUI : public BaseUI
        typedef std::map<pthread_t,RequestBuffer*> RequestBufferMap;
 
        RequestBufferMap request_buffers;
-       static Glib::StaticPrivate<RequestBuffer> per_thread_request_buffer;
+        static Glib::Threads::Private<RequestBuffer> per_thread_request_buffer;
        
-       Glib::Mutex               request_list_lock;
+       Glib::Threads::Mutex               request_list_lock;
        std::list<RequestObject*> request_list;
        
        RequestObject* get_request (RequestType);
index 65a9f27b49225b915fdad28c25881457b7535b99..186a3c55a659e346c7e723d5a2ba4f457adf5623 100644 (file)
@@ -26,7 +26,7 @@
 #include <sigc++/slot.h>
 #include <sigc++/trackable.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <glibmm/main.h>
 
 #include "pbd/crossthread.h"
@@ -50,8 +50,8 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
        BaseUI* base_instance() { return base_ui_instance; }
 
        Glib::RefPtr<Glib::MainLoop> main_loop() const { return _main_loop; }
-       Glib::Thread* event_loop_thread() const { return run_loop_thread; }
-       bool caller_is_self () const { return Glib::Thread::self() == run_loop_thread; }
+        Glib::Threads::Thread* event_loop_thread() const { return run_loop_thread; }
+        bool caller_is_self () const { return Glib::Threads::Thread::self() == run_loop_thread; }
 
        std::string name() const { return _name; }
 
@@ -75,9 +75,9 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
        bool _ok; 
 
        Glib::RefPtr<Glib::MainLoop> _main_loop;
-       Glib::Thread*                 run_loop_thread;
-       Glib::Mutex                  _run_lock;
-       Glib::Cond                   _running;
+        Glib::Threads::Thread*       run_loop_thread;
+       Glib::Threads::Mutex        _run_lock;
+        Glib::Threads::Cond         _running;
 
        /* this signals _running from within the event loop,
           from an idle callback 
index b23cdc7e97fbdb6f91c50167ce910caeab2f78d0..d9cd21d28dc24e3a455f2d8801793686b2fed9b9 100644 (file)
@@ -25,7 +25,7 @@
 #include <map>
 
 #include "pbd/signals.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/statefuldestructible.h"
 
@@ -105,7 +105,7 @@ class Controllable : public PBD::StatefulDestructible {
        static void remove (Controllable*);
 
        typedef std::set<PBD::Controllable*> Controllables;
-       static Glib::StaticRWLock registry_lock;
+        static Glib::Threads::RWLock registry_lock;
        static Controllables registry;
 };
 
index 450bf5752fcbc04cc0983baa6162d9a73abd17bd..b5ee9b80000785accf2475f5aa13b9ef1ae675a5 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <boost/function.hpp>
 #include <boost/bind.hpp> /* we don't need this here, but anything calling call_slot() probably will, so this is convenient */
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 namespace PBD
 {
@@ -69,13 +69,13 @@ class EventLoop
        };
 
        virtual void call_slot (InvalidationRecord*, const boost::function<void()>&) = 0;
-        virtual Glib::Mutex& slot_invalidation_mutex() = 0;
+        virtual Glib::Threads::Mutex& slot_invalidation_mutex() = 0;
 
        static EventLoop* get_event_loop_for_thread();
        static void set_event_loop_for_thread (EventLoop* ui);
 
   private:
-       static Glib::StaticPrivate<EventLoop> thread_event_loop;
+        static Glib::Threads::Private<EventLoop> thread_event_loop;
 
 };
 
index 01c9a8ee316cc5e36db6c5746e88dcd5f2f03140..14552f9fefaf16269a964f562de99613a353cfee 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <map>
 #include <list>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/signals.h"
 
 namespace PBD {
@@ -145,7 +145,7 @@ private:
        void close (FileDescriptor *);
 
        std::list<FileDescriptor*> _files; ///< files we know about
-       Glib::Mutex _mutex; ///< mutex for _files, _open and FileDescriptor contents
+       Glib::Threads::Mutex _mutex; ///< mutex for _files, _open and FileDescriptor contents
        int _open; ///< number of open files
        int _max_open; ///< maximum number of open files
 };
index 6296fc29812520825b45ad71e03f1ed05bd8e08a..6a9332be53b603fe6c6ef7a9bd016285ef8405a9 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdint.h>
 #include <string>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 namespace PBD {
 
@@ -63,7 +63,7 @@ class ID {
        uint64_t _id;
        int string_assign (std::string);
 
-       static Glib::Mutex* counter_lock;
+       static Glib::Threads::Mutex* counter_lock;
        static uint64_t _counter;
 };
 
index ab06343b4adfa3b649c91f79185f4eddee729603..fc8454cee7fb5eb70596789f561b765a1a7f02aa 100644 (file)
@@ -23,7 +23,7 @@
 #include <vector>
 #include <string>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/ringbuffer.h"
 
@@ -59,7 +59,7 @@ class SingleAllocMultiReleasePool : public Pool
        virtual void release (void *);
 
   private:
-    Glib::Mutex* m_lock;
+        Glib::Threads::Mutex m_lock;
 };
 
 
@@ -73,7 +73,7 @@ class MultiAllocSingleReleasePool : public Pool
        virtual void release (void *);
 
   private:
-    Glib::Mutex* m_lock;
+        Glib::Threads::Mutex m_lock;
 };
 
 class PerThreadPool;
@@ -106,7 +106,7 @@ class PerThreadPool
   public:
        PerThreadPool ();
 
-       GPrivate* key() const { return _key; }
+        const Glib::Threads::Private<CrossThreadPool>& key() const { return _key; }
 
        void  create_per_thread_pool (std::string name, unsigned long item_size, unsigned long nitems);
        CrossThreadPool* per_thread_pool ();
@@ -115,13 +115,13 @@ class PerThreadPool
        void add_to_trash (CrossThreadPool *);
 
   private:
-       GPrivate* _key;
+        Glib::Threads::Private<CrossThreadPool> _key;
        std::string _name;
        unsigned long _item_size;
        unsigned long _nitems;
 
        /** mutex to protect either changes to the _trash variable, or writes to the RingBuffer */
-       Glib::Mutex _trash_mutex;
+        Glib::Threads::Mutex _trash_mutex;
        RingBuffer<CrossThreadPool*>* _trash;
 };
 
index 7b053462946f0fcf047b25a8060b74d53b4c5f45..909954fc0e1a8a681d19f3d931d93a5cb6e8b938 100644 (file)
@@ -21,7 +21,7 @@
 #define __pbd_rcu_h__
 
 #include "boost/shared_ptr.hpp"
-#include "glibmm/thread.h"
+#include "glibmm/threads.h"
 
 #include <list>
 
@@ -187,12 +187,12 @@ public:
        }
 
        void flush () {
-               Glib::Mutex::Lock lm (m_lock);
+               Glib::Threads::Mutex::Lock lm (m_lock);
                m_dead_wood.clear ();
        }
 
 private:
-       Glib::Mutex                      m_lock;
+       Glib::Threads::Mutex                      m_lock;
        boost::shared_ptr<T>*            current_write_old;
        std::list<boost::shared_ptr<T> > m_dead_wood;
 };
index 8fd155111bb4d77becf5ce1c8f7a106f4071cb77..2167cadf5f27e70876ae5335a913e179e7e493a2 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <map>
 #include <sndfile.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "pbd/signals.h"
 #include "pbd/file_manager.h"
 
index 40275fd536d4ff9c5bf58dff7b5e7caa972b12ec..94d07cab96ba82bea8d948dad9c1e027698874aa 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <iostream>
 #include <ostream>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <list>
 
 #ifdef HAVE_EXECINFO
@@ -50,7 +50,7 @@ class thing_with_backtrace
 #else 
            allocation_backtrace_size = 0;
 #endif
-           Glib::Mutex::Lock lm (all_mutex);
+           Glib::Threads::Mutex::Lock lm (all_mutex);
            all.push_back (this);
     }
 
@@ -62,7 +62,7 @@ class thing_with_backtrace
 #else 
            allocation_backtrace_size = 0;
 #endif
-           Glib::Mutex::Lock lm (all_mutex);
+           Glib::Threads::Mutex::Lock lm (all_mutex);
            all.push_back (this);
     }
 
@@ -70,7 +70,7 @@ class thing_with_backtrace
            if (allocation_backtrace_size) {
                    delete [] allocation_backtrace;
            }
-           Glib::Mutex::Lock lm (all_mutex);
+           Glib::Threads::Mutex::Lock lm (all_mutex);
            all.remove (this);
     }
 
@@ -105,11 +105,11 @@ private:
     void** allocation_backtrace;
     int allocation_backtrace_size;
     static std::list<thing_with_backtrace<T>* > all;
-    static Glib::StaticMutex all_mutex;
+    static Glib::Threads::Mutex all_mutex;
 };
 
 template<typename T> std::list<PBD::thing_with_backtrace<T> *> PBD::thing_with_backtrace<T>::all;
-template<typename T> Glib::StaticMutex PBD::thing_with_backtrace<T>::all_mutex = GLIBMM_STATIC_MUTEX_INIT;
+template<typename T> Glib::Threads::Mutex PBD::thing_with_backtrace<T>::all_mutex;
 
 } // namespace PBD
 
index 36c6fe28c7184cac9633cf7c9efb564716816834..154e806644f1c26a5066c34a04a8590d722574ee 100644 (file)
@@ -110,7 +110,7 @@ class Stateful {
        XMLNode *_extra_xml;
        XMLNode *_instant_xml;
        PBD::PropertyChange     _pending_changed;
-        Glib::Mutex _lock;
+        Glib::Threads::Mutex _lock;
 
        std::string _xml_node_name; ///< name of node to use for this object in XML
        OwnedPropertyList* _properties;
index 0fc542f1ddc381c4fecfb199bdbc5bcd5eb023e9..7b24625727dc1d05dff0c2554a8c6398925f544a 100644 (file)
@@ -87,37 +87,27 @@ Pool::release (void *ptr)
 
 MultiAllocSingleReleasePool::MultiAllocSingleReleasePool (string n, unsigned long isize, unsigned long nitems) 
        : Pool (n, isize, nitems)
-       , m_lock(0)
 {
 }
 
 MultiAllocSingleReleasePool::~MultiAllocSingleReleasePool ()
 {
-    delete m_lock;
 }
 
 SingleAllocMultiReleasePool::SingleAllocMultiReleasePool (string n, unsigned long isize, unsigned long nitems) 
        : Pool (n, isize, nitems)
-       , m_lock(0)
 {
 }
 
 SingleAllocMultiReleasePool::~SingleAllocMultiReleasePool ()
 {
-    delete m_lock;
 }
 
 void*
 MultiAllocSingleReleasePool::alloc ()
 {
        void *ptr;
-    if(!m_lock) {
-        m_lock = new Glib::Mutex();
-        // umm, I'm not sure that this doesn't also allocate memory.
-        if(!m_lock) error << "cannot create Glib::Mutex in pool.cc" << endmsg;
-    }
-    
-    Glib::Mutex::Lock guard(*m_lock);
+       Glib::Threads::Mutex::Lock guard (m_lock);
        ptr = Pool::alloc ();
        return ptr;
 }
@@ -137,12 +127,7 @@ SingleAllocMultiReleasePool::alloc ()
 void
 SingleAllocMultiReleasePool::release (void* ptr)
 {
-    if(!m_lock) {
-        m_lock = new Glib::Mutex();
-        // umm, I'm not sure that this doesn't also allocate memory.
-        if(!m_lock) error << "cannot create Glib::Mutex in pool.cc" << endmsg;
-    }
-    Glib::Mutex::Lock guard(*m_lock);
+       Glib::Threads::Mutex::Lock guard (m_lock);
        Pool::release (ptr);
 }
 
@@ -173,14 +158,9 @@ free_per_thread_pool (void* ptr)
 }
  
 PerThreadPool::PerThreadPool ()
-       : _trash (0)
+       : _key (free_per_thread_pool)
+       , _trash (0)
 {
-       {
-               /* for some reason this appears necessary to get glib's thread private stuff to work */
-               g_private_new (NULL);
-       }
-
-       _key = g_private_new (free_per_thread_pool);
 }
 
 /** Create a new CrossThreadPool and set the current thread's private _key to point to it.
@@ -191,8 +171,7 @@ PerThreadPool::PerThreadPool ()
 void
 PerThreadPool::create_per_thread_pool (string n, unsigned long isize, unsigned long nitems)
 {
-       CrossThreadPool* p = new CrossThreadPool (n, isize, nitems, this);
-       g_private_set (_key, p);
+       _key.set (new CrossThreadPool (n, isize, nitems, this));
 }
 
 /** @return CrossThreadPool for the current thread, which must previously have been created by
@@ -201,7 +180,7 @@ PerThreadPool::create_per_thread_pool (string n, unsigned long isize, unsigned l
 CrossThreadPool*
 PerThreadPool::per_thread_pool ()
 {
-       CrossThreadPool* p = static_cast<CrossThreadPool*> (g_private_get (_key));
+       CrossThreadPool* p = _key.get();
        if (!p) {
                fatal << "programming error: no per-thread pool \"" << _name << "\" for thread " << pthread_self() << endmsg;
                /*NOTREACHED*/
@@ -212,7 +191,7 @@ PerThreadPool::per_thread_pool ()
 void
 PerThreadPool::set_trash (RingBuffer<CrossThreadPool*>* t)
 {
-       Glib::Mutex::Lock lm (_trash_mutex);
+       Glib::Threads::Mutex::Lock lm (_trash_mutex);
        _trash = t;
 }
 
@@ -220,7 +199,7 @@ PerThreadPool::set_trash (RingBuffer<CrossThreadPool*>* t)
 void
 PerThreadPool::add_to_trash (CrossThreadPool* p)
 {
-       Glib::Mutex::Lock lm (_trash_mutex);
+       Glib::Threads::Mutex::Lock lm (_trash_mutex);
        
        if (!_trash) {
                warning << "Pool " << p->name() << " has no trash collector; a memory leak has therefore occurred" << endmsg;
index 92d92da592a62dcaaac2531bdfd5b08dbb9b9d9e..e8b5e2690d1cccd80f5dd7ae8550be7ec66f8089 100644 (file)
@@ -33,7 +33,7 @@ using namespace std;
 typedef std::set<pthread_t> ThreadMap;
 static ThreadMap all_threads;
 static pthread_mutex_t thread_map_lock = PTHREAD_MUTEX_INITIALIZER;
-static Glib::StaticPrivate<char> thread_name;
+static Glib::Threads::Private<char> thread_name (free);
 
 namespace PBD {
        PBD::Signal4<void,std::string, pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize;
@@ -108,7 +108,7 @@ pthread_set_name (const char *str)
 {
        /* copy string and delete it when exiting */
        
-       thread_name.set (strdup (str), free);
+       thread_name.set (strdup (str));
 }
 
 const char *
index 3e8cd267a5b202d6ccf7a76d87f40e4c1fa6c776..105af75861d4e87ed4b120a78f4df4c0f1174db5 100644 (file)
@@ -278,7 +278,7 @@ Stateful::send_change (const PropertyChange& what_changed)
        }
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
                if (property_changes_suspended ()) {
                        _pending_changed.add (what_changed);
                        return;
@@ -300,7 +300,7 @@ Stateful::resume_property_changes ()
        PropertyChange what_changed;
 
        {
-               Glib::Mutex::Lock lm (_lock);
+               Glib::Threads::Mutex::Lock lm (_lock);
 
                if (property_changes_suspended() && g_atomic_int_dec_and_test (&_stateful_frozen) == FALSE) {
                        return;
index 0c7f600e2cbdf08b7b943e6a825d64e591b92e23..da7340182e2f663bd65c557ac4fb1a87a6820290 100644 (file)
@@ -8,7 +8,7 @@
 #include <pthread.h>
 #include <usb.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "ardour/types.h"
 
@@ -130,7 +130,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
 
        ARDOUR::gain_t  gain_fraction;
 
-       Glib::Mutex update_lock;
+        Glib::Threads::Mutex update_lock;
 
        bool screen_invalid[2][20];
        char screen_current[2][20];
index d6a75f66f900fad49bb76795d092ed2090379d81..e23e8725ae290e149dd994b0b01a43a9df72ca6c 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <glibmm/fileutils.h>
 #include <glibmm/miscutils.h>
-#include <glibmm/thread.h>
 
 #include "pbd/controllable_descriptor.h"
 #include "pbd/error.h"
@@ -186,8 +185,8 @@ GenericMidiControlProtocol::reload_maps ()
 void
 GenericMidiControlProtocol::drop_all ()
 {
-       Glib::Mutex::Lock lm (pending_lock);
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm (pending_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
 
        for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) {
                delete *i;
@@ -213,7 +212,7 @@ GenericMidiControlProtocol::drop_all ()
 void
 GenericMidiControlProtocol::drop_bindings ()
 {
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
 
        for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ) {
                if (!(*i)->learned()) {
@@ -286,7 +285,7 @@ GenericMidiControlProtocol::_send_feedback ()
           first on to ALSA.
        */
 
-       Glib::Mutex::Lock lm (controllables_lock, Glib::TRY_LOCK);
+       Glib::Threads::Mutex::Lock lm (controllables_lock, Glib::Threads::TRY_LOCK);
        if (!lm.locked ()) {
                return;
        }
@@ -306,7 +305,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
                return false;
        }
 
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
 
        MIDIControllables::iterator tmp;
        for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ) {
@@ -320,7 +319,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
        }
 
        {
-               Glib::Mutex::Lock lm (pending_lock);
+               Glib::Threads::Mutex::Lock lm (pending_lock);
                
                MIDIPendingControllables::iterator ptmp;
                for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) {
@@ -350,7 +349,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
        }
        
        {
-               Glib::Mutex::Lock lm (pending_lock);
+               Glib::Threads::Mutex::Lock lm (pending_lock);
 
                MIDIPendingControllable* element = new MIDIPendingControllable;
                element->first = mc;
@@ -366,8 +365,8 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
 void
 GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc)
 {
-       Glib::Mutex::Lock lm (pending_lock);
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm (pending_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
        
        MIDIPendingControllables::iterator tmp;
 
@@ -390,8 +389,8 @@ GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc)
 void
 GenericMidiControlProtocol::stop_learning (Controllable* c)
 {
-       Glib::Mutex::Lock lm (pending_lock);
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm (pending_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
        MIDIControllable* dptr = 0;
 
        /* learning timed out, and we've been told to consider this attempt to learn to be cancelled. find the
@@ -417,7 +416,7 @@ void
 GenericMidiControlProtocol::delete_binding (PBD::Controllable* control)
 {
        if (control != 0) {
-               Glib::Mutex::Lock lm2 (controllables_lock);
+               Glib::Threads::Mutex::Lock lm2 (controllables_lock);
                
                for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) {
                        MIDIControllable* existingBinding = (*iter);
@@ -437,7 +436,7 @@ void
 GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, int control_number)
 {
        if (control != NULL) {
-               Glib::Mutex::Lock lm2 (controllables_lock);
+               Glib::Threads::Mutex::Lock lm2 (controllables_lock);
                
                MIDI::channel_t channel = (pos & 0xf);
                MIDI::byte value = control_number;
@@ -489,7 +488,7 @@ GenericMidiControlProtocol::get_state ()
 
        node->add_child_nocopy (*children);
 
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
        for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) {
 
                /* we don't care about bindings that come from a bindings map, because
@@ -529,7 +528,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
        boost::shared_ptr<Controllable> c;
        
        {
-               Glib::Mutex::Lock lm (pending_lock);
+               Glib::Threads::Mutex::Lock lm (pending_lock);
                for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) {
                        delete *i;
                }
@@ -537,7 +536,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
        }
 
        {
-               Glib::Mutex::Lock lm2 (controllables_lock);
+               Glib::Threads::Mutex::Lock lm2 (controllables_lock);
                controllables.clear ();
                nlist = node.children(); // "Controls"
                
@@ -666,7 +665,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath)
                                /* controllable */
                                
                                if ((mc = create_binding (*child)) != 0) {
-                                       Glib::Mutex::Lock lm2 (controllables_lock);
+                                       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
                                        controllables.push_back (mc);
                                }
 
@@ -764,7 +763,7 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node)
 void
 GenericMidiControlProtocol::reset_controllables ()
 {
-       Glib::Mutex::Lock lm2 (controllables_lock);
+       Glib::Threads::Mutex::Lock lm2 (controllables_lock);
 
        for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ) {
                MIDIControllable* existingBinding = (*iter);
index ee1144a667174e38197df59d648303cb4117ff34..a7c420cc412cd98d0f272887bfcf13c04f500aa0 100644 (file)
@@ -21,7 +21,7 @@
 #define ardour_generic_midi_control_protocol_h
 
 #include <list>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "ardour/types.h"
 
 #include "control_protocol/control_protocol.h"
@@ -118,8 +118,8 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
        typedef std::pair<MIDIControllable*,PBD::ScopedConnection> MIDIPendingControllable;
        typedef std::list<MIDIPendingControllable* > MIDIPendingControllables;
        MIDIPendingControllables pending_controllables;
-       Glib::Mutex controllables_lock;
-       Glib::Mutex pending_lock;
+        Glib::Threads::Mutex controllables_lock;
+        Glib::Threads::Mutex pending_lock;
 
        bool start_learning (PBD::Controllable*);
        void stop_learning (PBD::Controllable*);
index 7a9e34195ee9ec38559300bfc92716b4c6bc3bd7..080aef1e3decf926c0571aedf567d0ac2f45b75a 100644 (file)
@@ -28,8 +28,6 @@
 #include <pthread.h>
 #include <boost/smart_ptr.hpp>
 
-#include <glibmm/thread.h>
-
 #include "pbd/abstract_ui.h"
 #include "midi++/types.h"
 #include "ardour/types.h"
index 70b1df4580d8153472f789be9d4c863211b4660c..7dc20a06f2753a1625ddee2145a546f1e3e3b8a0 100644 (file)
@@ -19,7 +19,6 @@
 #define surface_port_h
 
 #include <midi++/types.h>
-#include <glibmm/thread.h>
 
 #include "pbd/signals.h"
 #include "midi_byte_array.h"
index 53d64e8e98a2e1da57e1fc913f4282dd5f2b911f..1c318007b081f2f6610cbfc777c790c6eacab714 100644 (file)
@@ -33,7 +33,7 @@
 #include <usb.h>
 #endif
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include "ardour/types.h"
 
 #include "control_protocol/control_protocol.h"
@@ -170,7 +170,7 @@ private:
 
        ARDOUR::gain_t  gain_fraction;
 
-       Glib::Mutex update_lock;
+        Glib::Threads::Mutex update_lock;
 
         std::bitset<ROWS*COLUMNS> screen_invalid;
        char screen_current[ROWS][COLUMNS];
index c7c2cd59c907ab756306becccd59e99a7fd163e5..4ab19749e52dd8fdddab2779b886de7a22a61292 100644 (file)
@@ -4,7 +4,7 @@
 #include "ardour/types.h"
 #include "control_protocol/control_protocol.h"
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/abstract_ui.h"
 
@@ -16,7 +16,7 @@ namespace ARDOUR {
 }
 
 #define ENSURE_WIIMOTE_THREAD(slot) \
-       if (Glib::Thread::self() != main_thread) {\
+       if (Glib::Threads::Thread::self() != main_thread) {     \
                slot_mutex.lock();\
                slot_list.push_back(slot);\
                slot_cond.signal();\
@@ -26,42 +26,42 @@ namespace ARDOUR {
 
 
 class WiimoteControlProtocol : public ARDOUR::ControlProtocol {
-       public:
-               WiimoteControlProtocol (ARDOUR::Session &);
-               virtual ~WiimoteControlProtocol ();
-
-               static bool probe();
-
-               int set_active (bool yn);
-               XMLNode& get_state();
-               int set_state(const XMLNode&);
-
-               void wiimote_callback(cwiid_wiimote_t *, int, union cwiid_mesg [], 
-                                     struct timespec *);
-
-       private:
-               
-               void wiimote_main();
-               volatile bool main_thread_quit;
-               volatile bool restart_discovery;
-
-               Glib::Thread *main_thread;
-
-               void update_led_state();
-
-               bool callback_thread_registered_for_ardour;
-
-               static uint16_t button_state;
-
-               cwiid_wiimote_t *wiimote_handle;
-
-               Glib::Cond slot_cond;
-               Glib::Mutex slot_mutex;
-
-               std::list< sigc::slot<void> > slot_list;
-
-               sigc::connection transport_state_conn;
-               sigc::connection record_state_conn;
+  public:
+    WiimoteControlProtocol (ARDOUR::Session &);
+    virtual ~WiimoteControlProtocol ();
+    
+    static bool probe();
+    
+    int set_active (bool yn);
+    XMLNode& get_state();
+    int set_state(const XMLNode&);
+    
+    void wiimote_callback(cwiid_wiimote_t *, int, union cwiid_mesg [], 
+                         struct timespec *);
+    
+  private:
+    
+    void wiimote_main();
+    volatile bool main_thread_quit;
+    volatile bool restart_discovery;
+    
+    Glib::Threads::Thread *main_thread;
+    
+    void update_led_state();
+    
+    bool callback_thread_registered_for_ardour;
+    
+    static uint16_t button_state;
+    
+    cwiid_wiimote_t *wiimote_handle;
+    
+    Glib::Threads::Cond slot_cond;
+    Glib::Threads::Mutex slot_mutex;
+    
+    std::list< sigc::slot<void> > slot_list;
+    
+    sigc::connection transport_state_conn;
+    sigc::connection record_state_conn;
 };