summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-07-25 17:48:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-07-25 17:48:55 +0000
commit3cd8138a419cb165f56070ace0b21a1e63ec5a43 (patch)
tree51efe9abff24a1367be227aebf8e2901433b0b88 /libs
parenteb6e352dd0a307badf68ae4a216d15c03b4685de (diff)
convert from Glib:: to Glib::Threads for all thread-related API
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/amp.cc2
-rw-r--r--libs/ardour/analyser.cc13
-rw-r--r--libs/ardour/ardour/analyser.h6
-rw-r--r--libs/ardour/ardour/audioengine.h10
-rw-r--r--libs/ardour/ardour/audiosource.h6
-rw-r--r--libs/ardour/ardour/auditioner.h4
-rw-r--r--libs/ardour/ardour/auto_bundle.h2
-rw-r--r--libs/ardour/ardour/automation_list.h2
-rw-r--r--libs/ardour/ardour/automation_watch.h6
-rw-r--r--libs/ardour/ardour/buffer_manager.h4
-rw-r--r--libs/ardour/ardour/bundle.h4
-rw-r--r--libs/ardour/ardour/butler.h6
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h4
-rw-r--r--libs/ardour/ardour/diskstream.h4
-rw-r--r--libs/ardour/ardour/graph.h4
-rw-r--r--libs/ardour/ardour/internal_return.h2
-rw-r--r--libs/ardour/ardour/io.h4
-rw-r--r--libs/ardour/ardour/io_processor.h2
-rw-r--r--libs/ardour/ardour/location.h8
-rw-r--r--libs/ardour/ardour/logcurve.h4
-rw-r--r--libs/ardour/ardour/midi_diskstream.h2
-rw-r--r--libs/ardour/ardour/midi_model.h8
-rw-r--r--libs/ardour/ardour/midi_source.h2
-rw-r--r--libs/ardour/ardour/playlist.h12
-rw-r--r--libs/ardour/ardour/process_thread.h4
-rw-r--r--libs/ardour/ardour/region_factory.h6
-rw-r--r--libs/ardour/ardour/route.h8
-rw-r--r--libs/ardour/ardour/session.h12
-rw-r--r--libs/ardour/ardour/session_playlist.h2
-rw-r--r--libs/ardour/ardour/session_playlists.h4
-rw-r--r--libs/ardour/ardour/session_route.h2
-rw-r--r--libs/ardour/ardour/slave.h4
-rw-r--r--libs/ardour/ardour/source.h8
-rw-r--r--libs/ardour/ardour/source_factory.h6
-rw-r--r--libs/ardour/ardour/tempo.h6
-rw-r--r--libs/ardour/ardour/thread_buffers.h2
-rw-r--r--libs/ardour/ardour/user_bundle.h2
-rw-r--r--libs/ardour/ardour/worker.h16
-rw-r--r--libs/ardour/audio_diskstream.cc8
-rw-r--r--libs/ardour/audio_playlist_source.cc2
-rw-r--r--libs/ardour/audio_track.cc10
-rw-r--r--libs/ardour/audio_unit.cc2
-rw-r--r--libs/ardour/audioengine.cc15
-rw-r--r--libs/ardour/audiofilesource.cc4
-rw-r--r--libs/ardour/audioregion.cc2
-rw-r--r--libs/ardour/audiosource.cc24
-rw-r--r--libs/ardour/auditioner.cc6
-rw-r--r--libs/ardour/auto_bundle.cc8
-rw-r--r--libs/ardour/automatable.cc16
-rw-r--r--libs/ardour/automation_watch.cc13
-rw-r--r--libs/ardour/buffer_manager.cc6
-rw-r--r--libs/ardour/bundle.cc40
-rw-r--r--libs/ardour/butler.cc6
-rw-r--r--libs/ardour/control_protocol_manager.cc16
-rw-r--r--libs/ardour/diskstream.cc12
-rw-r--r--libs/ardour/file_source.cc4
-rw-r--r--libs/ardour/graph.cc6
-rw-r--r--libs/ardour/internal_return.cc8
-rw-r--r--libs/ardour/io.cc34
-rw-r--r--libs/ardour/location.cc26
-rw-r--r--libs/ardour/midi_diskstream.cc16
-rw-r--r--libs/ardour/midi_model.cc6
-rw-r--r--libs/ardour/midi_region.cc4
-rw-r--r--libs/ardour/midi_source.cc4
-rw-r--r--libs/ardour/midi_stretch.cc2
-rw-r--r--libs/ardour/midi_track.cc6
-rw-r--r--libs/ardour/mtc_slave.cc4
-rw-r--r--libs/ardour/plugin_insert.cc2
-rw-r--r--libs/ardour/process_thread.cc25
-rw-r--r--libs/ardour/region.cc2
-rw-r--r--libs/ardour/region_factory.cc28
-rw-r--r--libs/ardour/return.cc2
-rw-r--r--libs/ardour/route.cc112
-rw-r--r--libs/ardour/session.cc40
-rw-r--r--libs/ardour/session_butler.cc2
-rw-r--r--libs/ardour/session_click.cc4
-rw-r--r--libs/ardour/session_export.cc2
-rw-r--r--libs/ardour/session_playlists.cc24
-rw-r--r--libs/ardour/session_process.cc2
-rw-r--r--libs/ardour/session_state.cc20
-rw-r--r--libs/ardour/session_transport.cc2
-rw-r--r--libs/ardour/smf_source.cc6
-rw-r--r--libs/ardour/source.cc10
-rw-r--r--libs/ardour/source_factory.cc14
-rw-r--r--libs/ardour/tempo.cc62
-rw-r--r--libs/ardour/track.cc8
-rw-r--r--libs/ardour/user_bundle.cc2
-rw-r--r--libs/ardour/worker.cc2
-rw-r--r--libs/audiographer/audiographer/general/threader.h14
-rw-r--r--libs/audiographer/tests/test_runner.cc2
-rw-r--r--libs/evoral/evoral/ControlList.hpp14
-rw-r--r--libs/evoral/evoral/ControlSet.hpp6
-rw-r--r--libs/evoral/evoral/Sequence.hpp18
-rw-r--r--libs/evoral/src/ControlList.cpp50
-rw-r--r--libs/evoral/src/ControlSet.cpp4
-rw-r--r--libs/evoral/src/Curve.cpp6
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc4
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/gtk_ui.h6
-rw-r--r--libs/midi++2/ipmidi_port.cc2
-rw-r--r--libs/midi++2/jack_midi_port.cc2
-rw-r--r--libs/midi++2/midi++/ipmidi_port.h4
-rw-r--r--libs/midi++2/midi++/jack_midi_port.h2
-rw-r--r--libs/pbd/base_ui.cc6
-rw-r--r--libs/pbd/boost_debug.cc22
-rw-r--r--libs/pbd/controllable.cc10
-rw-r--r--libs/pbd/event_loop.cc8
-rw-r--r--libs/pbd/file_manager.cc8
-rw-r--r--libs/pbd/id.cc6
-rw-r--r--libs/pbd/pbd/abstract_ui.cc16
-rw-r--r--libs/pbd/pbd/abstract_ui.h10
-rw-r--r--libs/pbd/pbd/base_ui.h12
-rw-r--r--libs/pbd/pbd/controllable.h4
-rw-r--r--libs/pbd/pbd/event_loop.h6
-rw-r--r--libs/pbd/pbd/file_manager.h4
-rw-r--r--libs/pbd/pbd/id.h4
-rw-r--r--libs/pbd/pbd/pool.h12
-rw-r--r--libs/pbd/pbd/rcu.h6
-rw-r--r--libs/pbd/pbd/sndfile_manager.h2
-rw-r--r--libs/pbd/pbd/stacktrace.h12
-rw-r--r--libs/pbd/pbd/stateful.h2
-rw-r--r--libs/pbd/pool.cc37
-rw-r--r--libs/pbd/pthread_utils.cc4
-rw-r--r--libs/pbd/stateful.cc4
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.h4
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc37
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.h6
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h2
-rw-r--r--libs/surfaces/mackie/surface_port.h1
-rw-r--r--libs/surfaces/tranzport/tranzport_control_protocol.h4
-rw-r--r--libs/surfaces/wiimote/wiimote.h76
130 files changed, 652 insertions, 691 deletions
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc
index 80dd7422e9..d68f73ef3e 100644
--- a/libs/ardour/amp.cc
+++ b/libs/ardour/amp.cc
@@ -449,7 +449,7 @@ Amp::GainControl::internal_to_user (double v) const
void
Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes)
{
- Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK);
+ Glib::Threads::Mutex::Lock am (control_lock(), Glib::Threads::TRY_LOCK);
if (am.locked() && _session.transport_rolling() && _gain_control->automation_playback()) {
assert (_gain_automation_buffer);
diff --git a/libs/ardour/analyser.cc b/libs/ardour/analyser.cc
index 730ea4169a..bf98ecc20a 100644
--- a/libs/ardour/analyser.cc
+++ b/libs/ardour/analyser.cc
@@ -27,8 +27,8 @@ using namespace ARDOUR;
using namespace PBD;
Analyser* Analyser::the_analyser = 0;
-Glib::StaticMutex Analyser::analysis_queue_lock = GLIBMM_STATIC_MUTEX_INIT;
-Glib::Cond* Analyser::SourcesToAnalyse = 0;
+Glib::Threads::Mutex Analyser::analysis_queue_lock;
+Glib::Threads::Cond Analyser::SourcesToAnalyse;
list<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()) {
diff --git a/libs/ardour/ardour/analyser.h b/libs/ardour/ardour/analyser.h
index 15e4220ad6..aae16e443f 100644
--- a/libs/ardour/ardour/analyser.h
+++ b/libs/ardour/ardour/analyser.h
@@ -1,7 +1,7 @@
#ifndef __ardour_analyser_h__
#define __ardour_analyser_h__
-#include <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>);
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index 73e40e8ab4..1c0d0f1a55 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -31,7 +31,7 @@
#include <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;
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index c6ec2a56ad..cbdcd296af 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -25,7 +25,7 @@
#include <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;
diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h
index 3650f0c92c..bdd04fcc66 100644
--- a/libs/ardour/ardour/auditioner.h
+++ b/libs/ardour/ardour/auditioner.h
@@ -22,7 +22,7 @@
#include <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;
diff --git a/libs/ardour/ardour/auto_bundle.h b/libs/ardour/ardour/auto_bundle.h
index b41a5d344f..d97080c089 100644
--- a/libs/ardour/ardour/auto_bundle.h
+++ b/libs/ardour/ardour/auto_bundle.h
@@ -21,7 +21,7 @@
#define __ardour_auto_bundle_h__
#include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "ardour/bundle.h"
namespace ARDOUR {
diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h
index 01c9d0641a..e7377d6b02 100644
--- a/libs/ardour/ardour/automation_list.h
+++ b/libs/ardour/ardour/automation_list.h
@@ -24,7 +24,7 @@
#include <list>
#include <cmath>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "pbd/undo.h"
#include "pbd/xml++.h"
diff --git a/libs/ardour/ardour/automation_watch.h b/libs/ardour/ardour/automation_watch.h
index bb5ef69385..6fd5a0eb65 100644
--- a/libs/ardour/ardour/automation_watch.h
+++ b/libs/ardour/ardour/automation_watch.h
@@ -19,7 +19,7 @@
#include <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 ();
diff --git a/libs/ardour/ardour/buffer_manager.h b/libs/ardour/ardour/buffer_manager.h
index e3ac981e63..2a8e7be6da 100644
--- a/libs/ardour/ardour/buffer_manager.h
+++ b/libs/ardour/ardour/buffer_manager.h
@@ -7,7 +7,7 @@
#include "ardour/chan_count.h"
#include <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;
diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h
index e84349c647..02845481b6 100644
--- a/libs/ardour/ardour/bundle.h
+++ b/libs/ardour/ardour/bundle.h
@@ -22,7 +22,7 @@
#include <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:
diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h
index 061c94d910..cdd48c3e3a 100644
--- a/libs/ardour/ardour/butler.h
+++ b/libs/ardour/ardour/butler.h
@@ -20,7 +20,7 @@
#ifndef __ardour_butler_h__
#define __ardour_butler_h__
-#include <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];
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index 20358025f1..80c9668763 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -24,7 +24,7 @@
#include <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 ();
diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h
index bbc3a85dbe..5d3693052d 100644
--- a/libs/ardour/ardour/diskstream.h
+++ b/libs/ardour/ardour/diskstream.h
@@ -250,7 +250,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
static framecnt_t disk_io_chunk_frames;
std::vector<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;
diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h
index e5c03ad134..cac09d34af 100644
--- a/libs/ardour/ardour/graph.h
+++ b/libs/ardour/ardour/graph.h
@@ -122,8 +122,8 @@ private:
bool _graph_empty;
// chain swapping
- Glib::Mutex _swap_mutex;
- Glib::Cond _cleanup_cond;
+ Glib::Threads::Mutex _swap_mutex;
+ Glib::Threads::Cond _cleanup_cond;
volatile int _current_chain;
volatile int _pending_chain;
volatile int _setup_chain;
diff --git a/libs/ardour/ardour/internal_return.h b/libs/ardour/ardour/internal_return.h
index 291b51896c..c7fe04cc42 100644
--- a/libs/ardour/ardour/internal_return.h
+++ b/libs/ardour/ardour/internal_return.h
@@ -48,7 +48,7 @@ class InternalReturn : public Return
/** sends that we are receiving data from */
std::list<InternalSend*> _sends;
/** mutex to protect _sends */
- Glib::Mutex _sends_mutex;
+ Glib::Threads::Mutex _sends_mutex;
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index d38aa88576..69297fff04 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -25,7 +25,7 @@
#include <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;
diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h
index 3d59230b26..7adfab2225 100644
--- a/libs/ardour/ardour/io_processor.h
+++ b/libs/ardour/ardour/io_processor.h
@@ -23,7 +23,7 @@
#include <string>
#include <boost/shared_ptr.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "pbd/undo.h"
diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h
index 069230438e..414f332b5e 100644
--- a/libs/ardour/ardour/location.h
+++ b/libs/ardour/ardour/location.h
@@ -27,7 +27,7 @@
#include <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*);
diff --git a/libs/ardour/ardour/logcurve.h b/libs/ardour/ardour/logcurve.h
index a5f0ce4734..4c91ad9a79 100644
--- a/libs/ardour/ardour/logcurve.h
+++ b/libs/ardour/ardour/logcurve.h
@@ -21,7 +21,7 @@
#define __ardour_logcurve_h__
#include "pbd/fastlog.h"
-#include <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;
diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h
index 99513734da..0823a5f8ac 100644
--- a/libs/ardour/ardour/midi_diskstream.h
+++ b/libs/ardour/ardour/midi_diskstream.h
@@ -199,7 +199,7 @@ class MidiDiskstream : public Diskstream
the GUI to read (so that it can update itself).
*/
MidiBuffer _gui_feed_buffer;
- mutable Glib::Mutex _gui_feed_buffer_mutex;
+ mutable Glib::Threads::Mutex _gui_feed_buffer_mutex;
};
}; /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h
index d0a05e131d..38bd3ab982 100644
--- a/libs/ardour/ardour/midi_model.h
+++ b/libs/ardour/ardour/midi_model.h
@@ -25,7 +25,7 @@
#include <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:
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index 1d4ba56ba3..1a7f3b07c5 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -22,7 +22,7 @@
#include <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"
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index a64ebdd727..6de772390e 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -230,16 +230,16 @@ public:
friend class Session;
protected:
- class RegionReadLock : public Glib::RWLock::ReaderLock {
+ class RegionReadLock : public Glib::Threads::RWLock::ReaderLock {
public:
- RegionReadLock (Playlist *pl) : Glib::RWLock::ReaderLock (pl->region_lock) {}
+ RegionReadLock (Playlist *pl) : Glib::Threads::RWLock::ReaderLock (pl->region_lock) {}
~RegionReadLock() {}
};
- class RegionWriteLock : public Glib::RWLock::WriterLock {
+ class RegionWriteLock : public Glib::Threads::RWLock::WriterLock {
public:
RegionWriteLock (Playlist *pl, bool do_block_notify = true)
- : Glib::RWLock::WriterLock (pl->region_lock)
+ : Glib::Threads::RWLock::WriterLock (pl->region_lock)
, playlist (pl)
, block_notify (do_block_notify) {
if (block_notify) {
@@ -248,7 +248,7 @@ public:
}
~RegionWriteLock() {
- Glib::RWLock::WriterLock::release ();
+ Glib::Threads::RWLock::WriterLock::release ();
if (block_notify) {
playlist->release_notifications ();
}
@@ -375,7 +375,7 @@ public:
private:
friend class RegionReadLock;
friend class RegionWriteLock;
- mutable Glib::RWLock region_lock;
+ mutable Glib::Threads::RWLock region_lock;
private:
void setup_layering_indices (RegionList const &);
diff --git a/libs/ardour/ardour/process_thread.h b/libs/ardour/ardour/process_thread.h
index 6dd91aa305..871a2584d5 100644
--- a/libs/ardour/ardour/process_thread.h
+++ b/libs/ardour/ardour/process_thread.h
@@ -1,7 +1,7 @@
#ifndef __libardour_process_thread__
#define __libardour_process_thread__
-#include <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
diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h
index 471f172440..ed0c962d87 100644
--- a/libs/ardour/ardour/region_factory.h
+++ b/libs/ardour/ardour/region_factory.h
@@ -22,7 +22,7 @@
#include <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 */
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 62a694071f..b2e3d1236e 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -32,7 +32,7 @@
#include <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;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 780c68f2b0..5f20df029c 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -34,7 +34,7 @@
#include <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;
diff --git a/libs/ardour/ardour/session_playlist.h b/libs/ardour/ardour/session_playlist.h
index 7f5d1e89ce..fa1acc5828 100644
--- a/libs/ardour/ardour/session_playlist.h
+++ b/libs/ardour/ardour/session_playlist.h
@@ -29,7 +29,7 @@ namespace ARDOUR {
template<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);
diff --git a/libs/ardour/ardour/session_playlists.h b/libs/ardour/ardour/session_playlists.h
index 5f69ba8001..83dc8ee58c 100644
--- a/libs/ardour/ardour/session_playlists.h
+++ b/libs/ardour/ardour/session_playlists.h
@@ -23,7 +23,7 @@
#include <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;
diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h
index cfaa13cdc8..19d8614d1b 100644
--- a/libs/ardour/ardour/session_route.h
+++ b/libs/ardour/ardour/session_route.h
@@ -22,7 +22,7 @@
#include <iostream>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "ardour/session.h"
#include "ardour/route.h"
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h
index a487824e51..1602b8bc8e 100644
--- a/libs/ardour/ardour/slave.h
+++ b/libs/ardour/ardour/slave.h
@@ -22,7 +22,7 @@
#include <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;
diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h
index e65b4cb093..a3b5fd817a 100644
--- a/libs/ardour/ardour/source.h
+++ b/libs/ardour/ardour/source.h
@@ -23,7 +23,7 @@
#include <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 */
diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h
index 5ddf1f8735..387a40aff3 100644
--- a/libs/ardour/ardour/source_factory.h
+++ b/libs/ardour/ardour/source_factory.h
@@ -24,6 +24,8 @@
#include <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);
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index 15032b8741..8e4f1bc420 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -24,7 +24,7 @@
#include <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);
diff --git a/libs/ardour/ardour/thread_buffers.h b/libs/ardour/ardour/thread_buffers.h
index be8cb42282..9011e98e43 100644
--- a/libs/ardour/ardour/thread_buffers.h
+++ b/libs/ardour/ardour/thread_buffers.h
@@ -1,7 +1,7 @@
#ifndef __libardour_thread_buffers__
#define __libardour_thread_buffers__
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "ardour/chan_count.h"
#include "ardour/types.h"
diff --git a/libs/ardour/ardour/user_bundle.h b/libs/ardour/ardour/user_bundle.h
index c124e2e722..5ecfe521f5 100644
--- a/libs/ardour/ardour/user_bundle.h
+++ b/libs/ardour/ardour/user_bundle.h
@@ -21,7 +21,7 @@
#define __ardour_user_bundle_h__
#include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "pbd/stateful.h"
#include "ardour/bundle.h"
diff --git a/libs/ardour/ardour/worker.h b/libs/ardour/ardour/worker.h
index 984e375c80..fe278b9618 100644
--- a/libs/ardour/ardour/worker.h
+++ b/libs/ardour/ardour/worker.h
@@ -22,7 +22,7 @@
#include <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
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 8e6b5c27f1..3345a00b42 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -151,7 +151,7 @@ void
AudioDiskstream::non_realtime_input_change ()
{
{
- Glib::Mutex::Lock lm (state_lock);
+ Glib::Threads::Mutex::Lock lm (state_lock);
if (input_change_pending.type == IOChange::NoChange) {
return;
@@ -430,7 +430,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecn
return 0;
}
- Glib::Mutex::Lock sm (state_lock, Glib::TRY_LOCK);
+ Glib::Threads::Mutex::Lock sm (state_lock, Glib::Threads::TRY_LOCK);
if (!sm.locked()) {
return 1;
@@ -812,7 +812,7 @@ AudioDiskstream::seek (framepos_t frame, bool complete_refill)
ChannelList::iterator chan;
boost::shared_ptr<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;
diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc
index ea09d20056..915aee9595 100644
--- a/libs/ardour/audio_playlist_source.cc
+++ b/libs/ardour/audio_playlist_source.cc
@@ -151,7 +151,7 @@ AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cn
with any changes to the list of buffers caused
by creating new nested playlists/sources
*/
- Glib::Mutex::Lock lm (_level_buffer_lock);
+ Glib::Threads::Mutex::Lock lm (_level_buffer_lock);
sbuf = _mixdown_buffers[_level-1];
gbuf = _gain_buffers[_level-1];
}
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index 4079cdb481..2801a4e997 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -310,7 +310,7 @@ AudioTrack::set_state_part_two ()
int
AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
{
- Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
@@ -483,7 +483,7 @@ AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nfram
boost::scoped_array<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()) {
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index f7f3587e7d..89aa99bac8 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -31,7 +31,7 @@
#include "pbd/pathscanner.h"
#include "pbd/locale_guard.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 004ba33a6e..450bf2a296 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -94,7 +94,7 @@ AudioEngine::AudioEngine (string client_name, string session_uuid)
AudioEngine::~AudioEngine ()
{
{
- Glib::Mutex::Lock tm (_process_lock);
+ Glib::Threads::Mutex::Lock tm (_process_lock);
session_removed.signal ();
if (_running) {
@@ -453,7 +453,7 @@ int
AudioEngine::process_callback (pframes_t nframes)
{
GET_PRIVATE_JACK_POINTER_RET(_jack,0);
- Glib::Mutex::Lock tm (_process_lock, Glib::TRY_LOCK);
+ Glib::Threads::Mutex::Lock tm (_process_lock, Glib::Threads::TRY_LOCK);
PT_TIMING_REF;
PT_TIMING_CHECK (1);
@@ -714,7 +714,7 @@ AudioEngine::jack_bufsize_callback (pframes_t nframes)
}
{
- Glib::Mutex::Lock lm (_process_lock);
+ Glib::Threads::Mutex::Lock lm (_process_lock);
boost::shared_ptr<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;
}
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index e101f5b25b..2486d45ca1 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -42,7 +42,7 @@
#include <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)
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 41b3ceedc9..577f12c78e 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -26,7 +26,7 @@
#include <boost/scoped_array.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "pbd/basename.h"
#include "pbd/xml++.h"
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index e33a3d30de..4deb053cd8 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -46,7 +46,7 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
-Glib::StaticMutex AudioSource::_level_buffer_lock = GLIBMM_STATIC_MUTEX_INIT;
+Glib::Threads::Mutex AudioSource::_level_buffer_lock;
vector<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);
}
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index 6c143568c4..ad4d8b5d16 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -17,7 +17,7 @@
*/
-#include <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"),
diff --git a/libs/ardour/auto_bundle.cc b/libs/ardour/auto_bundle.cc
index bedb270dc5..366d32b979 100644
--- a/libs/ardour/auto_bundle.cc
+++ b/libs/ardour/auto_bundle.cc
@@ -16,7 +16,7 @@ ARDOUR::AutoBundle::AutoBundle (std::string const & n, bool i)
ARDOUR::ChanCount
ARDOUR::AutoBundle::nchannels () const
{
- Glib::Mutex::Lock lm (_ports_mutex);
+ Glib::Threads::Mutex::Lock lm (_ports_mutex);
return ChanCount (type(), _ports.size ());
}
@@ -25,14 +25,14 @@ ARDOUR::AutoBundle::channel_ports (uint32_t c) const
{
assert (c < nchannels().get (type()));
- Glib::Mutex::Lock lm (_ports_mutex);
+ Glib::Threads::Mutex::Lock lm (_ports_mutex);
return _ports[c];
}
void
ARDOUR::AutoBundle::set_channels (uint32_t n)
{
- Glib::Mutex::Lock lm (_ports_mutex);
+ Glib::Threads::Mutex::Lock lm (_ports_mutex);
_ports.resize (n);
}
@@ -41,7 +41,7 @@ ARDOUR::AutoBundle::set_port (uint32_t c, std::string const & p)
{
assert (c < nchannels ().get (type()));
- Glib::Mutex::Lock lm (_ports_mutex);
+ Glib::Threads::Mutex::Lock lm (_ports_mutex);
_ports[c].resize (1);
_ports[c][0] = p;
}
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index 608ae745de..0f6fbdbe17 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -54,7 +54,7 @@ Automatable::Automatable (const Automatable& other)
: ControlSet (other)
, _a_session (other._a_session)
{
- Glib::Mutex::Lock lm (other._control_lock);
+ Glib::Threads::Mutex::Lock lm (other._control_lock);
for (Controls::const_iterator i = other._controls.begin(); i != other._controls.end(); ++i) {
boost::shared_ptr<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());
diff --git a/libs/ardour/automation_watch.cc b/libs/ardour/automation_watch.cc
index 5fefcaca8d..d3138ee336 100644
--- a/libs/ardour/automation_watch.cc
+++ b/libs/ardour/automation_watch.cc
@@ -57,14 +57,14 @@ AutomationWatch::~AutomationWatch ()
_thread = 0;
}
- Glib::Mutex::Lock lm (automation_watch_lock);
+ Glib::Threads::Mutex::Lock lm (automation_watch_lock);
automation_watches.clear ();
}
void
AutomationWatch::add_automation_watch (boost::shared_ptr<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",
diff --git a/libs/ardour/buffer_manager.cc b/libs/ardour/buffer_manager.cc
index 71ff4946f3..c8819e41cb 100644
--- a/libs/ardour/buffer_manager.cc
+++ b/libs/ardour/buffer_manager.cc
@@ -29,7 +29,7 @@ using namespace PBD;
RingBufferNPT<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;
}
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index 5040882b7a..f38fe0c42f 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -67,7 +67,7 @@ Bundle::Bundle (boost::shared_ptr<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;
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc
index 3e9c7b0d96..db1b316368 100644
--- a/libs/ardour/butler.cc
+++ b/libs/ardour/butler.cc
@@ -311,7 +311,7 @@ restart:
{
- Glib::Mutex::Lock lm (request_lock);
+ Glib::Threads::Mutex::Lock lm (request_lock);
if (should_run && (disk_work_outstanding || transport_work_requested())) {
// for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
@@ -349,7 +349,7 @@ Butler::summon ()
void
Butler::stop ()
{
- Glib::Mutex::Lock lm (request_lock);
+ Glib::Threads::Mutex::Lock lm (request_lock);
char c = Request::Pause;
(void) ::write (request_pipe[1], &c, 1);
paused.wait(request_lock);
@@ -358,7 +358,7 @@ Butler::stop ()
void
Butler::wait_until_finished ()
{
- Glib::Mutex::Lock lm (request_lock);
+ Glib::Threads::Mutex::Lock lm (request_lock);
char c = Request::Pause;
(void) ::write (request_pipe[1], &c, 1);
paused.wait(request_lock);
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index 509f883aed..8611447a93 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -46,7 +46,7 @@ ControlProtocolManager::ControlProtocolManager ()
ControlProtocolManager::~ControlProtocolManager()
{
- Glib::Mutex::Lock lm (protocols_lock);
+ Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<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 ();
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index 7a0b0a81b1..553e29244f 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -31,7 +31,7 @@
#include <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;
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index 3017615948..cd39faa08e 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -36,7 +36,7 @@
#include <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);
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index 300271c21a..d2fbdbf552 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -101,7 +101,7 @@ Graph::reset_thread_list ()
return;
}
- Glib::Mutex::Lock lm (_session.engine().process_lock());
+ Glib::Threads::Mutex::Lock lm (_session.engine().process_lock());
pthread_t a_thread;
if (!_thread_list.empty()) {
@@ -162,7 +162,7 @@ Graph::drop_threads ()
void
Graph::clear_other_chain ()
{
- Glib::Mutex::Lock ls (_swap_mutex);
+ Glib::Threads::Mutex::Lock ls (_swap_mutex);
while (1) {
if (_setup_chain != _pending_chain) {
@@ -275,7 +275,7 @@ Graph::restart_cycle()
void
Graph::rechain (boost::shared_ptr<RouteList> routelist, GraphEdges const & edges)
{
- Glib::Mutex::Lock ls (_swap_mutex);
+ Glib::Threads::Mutex::Lock ls (_swap_mutex);
int chain = _setup_chain;
DEBUG_TRACE (DEBUG::Graph, string_compose ("============== setup %1\n", chain));
diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc
index ad2ed81194..af6b6110b6 100644
--- a/libs/ardour/internal_return.cc
+++ b/libs/ardour/internal_return.cc
@@ -16,7 +16,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <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);
}
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 01a4a64a38..d39ba7b4f9 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -25,7 +25,7 @@
#include <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);
}
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index e909957e0d..96a289e06f 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -573,7 +573,7 @@ Locations::set_current (Location *loc, bool want_lock)
int ret;
if (want_lock) {
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
ret = set_current_unlocked (loc);
} else {
ret = set_current_unlocked (loc);
@@ -635,7 +635,7 @@ void
Locations::clear ()
{
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
@@ -660,7 +660,7 @@ void
Locations::clear_markers ()
{
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
LocationList::iterator tmp;
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
@@ -682,7 +682,7 @@ void
Locations::clear_ranges ()
{
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
LocationList::iterator tmp;
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
@@ -711,7 +711,7 @@ Locations::add (Location *loc, bool make_current)
assert (loc);
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
locations.push_back (loc);
if (make_current) {
@@ -743,7 +743,7 @@ Locations::remove (Location *loc)
}
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
for (i = locations.begin(); i != locations.end(); ++i) {
if ((*i) == loc) {
@@ -781,7 +781,7 @@ Locations::get_state ()
{
XMLNode *node = new XMLNode ("Locations");
LocationList::iterator iter;
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
for (iter = locations.begin(); iter != locations.end(); ++iter) {
node->add_child_nocopy ((*iter)->get_state ());
@@ -812,7 +812,7 @@ Locations::set_state (const XMLNode& node, int version)
}
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
XMLNodeConstIterator niter;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
@@ -910,7 +910,7 @@ Locations::first_location_before (framepos_t frame, bool include_special_ranges)
LocationList locs;
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
locs = locations;
}
@@ -937,7 +937,7 @@ Locations::first_location_after (framepos_t frame, bool include_special_ranges)
LocationList locs;
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
locs = locations;
}
@@ -973,7 +973,7 @@ Locations::marks_either_side (framepos_t const frame, framepos_t& before, framep
LocationList locs;
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
locs = locations;
}
@@ -1067,7 +1067,7 @@ uint32_t
Locations::num_range_markers () const
{
uint32_t cnt = 0;
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
if ((*i)->is_range_marker()) {
++cnt;
@@ -1090,7 +1090,7 @@ Locations::get_location_by_id(PBD::ID id)
void
Locations::find_all_between (framepos_t start, framepos_t end, LocationList& ll, Location::Flags flags)
{
- Glib::Mutex::Lock lm (lock);
+ Glib::Threads::Mutex::Lock lm (lock);
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
if ((flags == 0 || (*i)->matches (flags)) &&
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index 5e2a6e23b9..64f02b0ad9 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -31,7 +31,7 @@
#include "pbd/error.h"
#include "pbd/basename.h"
-#include <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;
}
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index a914a0d887..e86b229c71 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -1555,7 +1555,7 @@ MidiModel::edit_lock()
boost::shared_ptr<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);
}
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index 518413e2de..8509e55f97 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -24,7 +24,7 @@
#include <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 ();
}
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index 96e7b2b934..92795db4ae 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -195,7 +195,7 @@ MidiSource::midi_read (Evoral::EventSink<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);
diff --git a/libs/ardour/midi_stretch.cc b/libs/ardour/midi_stretch.cc
index aa03def614..1794d5ff93 100644
--- a/libs/ardour/midi_stretch.cc
+++ b/libs/ardour/midi_stretch.cc
@@ -85,7 +85,7 @@ MidiStretch::run (boost::shared_ptr<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();
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index 800e7949d5..0f73292c67 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -276,7 +276,7 @@ MidiTrack::set_state_part_two ()
int
MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
{
- Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
@@ -401,7 +401,7 @@ MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr
void
MidiTrack::realtime_locate ()
{
- Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked ()) {
return;
@@ -417,7 +417,7 @@ MidiTrack::realtime_locate ()
void
MidiTrack::realtime_handle_transport_stopped ()
{
- Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked ()) {
return;
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc
index 6c95730f24..1176c59f25 100644
--- a/libs/ardour/mtc_slave.cc
+++ b/libs/ardour/mtc_slave.cc
@@ -482,7 +482,7 @@ MTC_Slave::resolution () const
void
MTC_Slave::queue_reset (bool reset_pos)
{
- Glib::Mutex::Lock lm (reset_lock);
+ Glib::Threads::Mutex::Lock lm (reset_lock);
reset_pending++;
if (reset_pos) {
reset_position = true;
@@ -492,7 +492,7 @@ MTC_Slave::queue_reset (bool reset_pos)
void
MTC_Slave::maybe_reset ()
{
- Glib::Mutex::Lock lm (reset_lock);
+ Glib::Threads::Mutex::Lock lm (reset_lock);
if (reset_pending) {
reset (reset_position);
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index f390e190f5..23cebf4276 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -552,7 +552,7 @@ PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes)
framepos_t end = now + nframes;
framecnt_t offset = 0;
- Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK);
+ Glib::Threads::Mutex::Lock lm (control_lock(), Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
connect_and_run (bufs, nframes, offset, false);
diff --git a/libs/ardour/process_thread.cc b/libs/ardour/process_thread.cc
index 5d3b54cb13..e10ccf160c 100644
--- a/libs/ardour/process_thread.cc
+++ b/libs/ardour/process_thread.cc
@@ -29,20 +29,17 @@ using namespace ARDOUR;
using namespace Glib;
using namespace std;
-Private<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;
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 2166741dda..c74ce4e419 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -23,7 +23,7 @@
#include <algorithm>
#include <sstream>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "pbd/xml++.h"
#include "ardour/debug.h"
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc
index ddc0451523..3e81524750 100644
--- a/libs/ardour/region_factory.cc
+++ b/libs/ardour/region_factory.cc
@@ -36,10 +36,10 @@ using namespace PBD;
using namespace std;
PBD::Signal1<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;
}
diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc
index 43a2e1bfd1..519f3ca494 100644
--- a/libs/ardour/return.cc
+++ b/libs/ardour/return.cc
@@ -151,7 +151,7 @@ Return::configure_io (ChanCount in, ChanCount out)
// Ensure there are enough buffers (since we add some)
if (_session.get_scratch_buffers(in).count() < out) {
- Glib::Mutex::Lock em (_session.engine().process_lock());
+ Glib::Threads::Mutex::Lock em (_session.engine().process_lock());
IO::PortCountChanged(out);
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index de4a583291..a540e0aa93 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -168,7 +168,7 @@ Route::init ()
{
/* run a configure so that the invisible processors get set up */
- Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
+ Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
configure_processors (0);
}
@@ -188,7 +188,7 @@ Route::~Route ()
be half-destroyed by now
*/
- Glib::RWLock::WriterLock lm (_processor_lock);
+ Glib::Threads::RWLock::WriterLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->drop_references ();
}
@@ -885,7 +885,7 @@ dump_processors(const string& name, const list<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);
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 59667b2fce..3d7535d5e5 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -30,7 +30,7 @@
#include <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);
}
diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc
index 88f61335e0..1d235b051a 100644
--- a/libs/ardour/session_butler.cc
+++ b/libs/ardour/session_butler.cc
@@ -25,7 +25,7 @@
#include <fcntl.h>
#include <poll.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "pbd/error.h"
#include "pbd/pthread_utils.h"
diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc
index abfbaecfcd..e6e8749aec 100644
--- a/libs/ardour/session_click.cc
+++ b/libs/ardour/session_click.cc
@@ -51,7 +51,7 @@ Session::click (framepos_t start, framecnt_t nframes)
return;
}
- Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK);
+ Glib::Threads::RWLock::WriterLock clickm (click_lock, Glib::Threads::TRY_LOCK);
/* how far have we moved since the last time the clicks got cleared
*/
@@ -225,7 +225,7 @@ Session::setup_click_sounds (int which)
void
Session::clear_clicks ()
{
- Glib::RWLock::WriterLock lm (click_lock);
+ Glib::Threads::RWLock::WriterLock lm (click_lock);
for (Clicks::iterator i = clicks.begin(); i != clicks.end(); ++i) {
delete *i;
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index acb23aee8b..1c1b4f9a0f 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -19,7 +19,7 @@
#include "pbd/error.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include <midi++/manager.h>
#include <midi++/mmc.h>
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc
index b833aea1f2..ac3baf2008 100644
--- a/libs/ardour/session_playlists.cc
+++ b/libs/ardour/session_playlists.cc
@@ -69,7 +69,7 @@ SessionPlaylists::~SessionPlaylists ()
bool
SessionPlaylists::add (boost::shared_ptr<Playlist> 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) {
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 6cebc13b0d..019f491a4a 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -25,7 +25,7 @@
#include "pbd/error.h"
#include "pbd/enumwriter.h"
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "ardour/audioengine.h"
#include "ardour/auditioner.h"
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 6661d33c9a..3ef2e0d521 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -54,7 +54,7 @@
#include <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 ());
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 795a106685..7502ded288 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -921,7 +921,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
/* this is functionally what clear_clicks() does but with a tentative lock */
- Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK);
+ Glib::Threads::RWLock::WriterLock clickm (click_lock, Glib::Threads::TRY_LOCK);
if (clickm.locked()) {
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 368982f10d..47c653a698 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -427,7 +427,7 @@ SMFSource::mark_streaming_write_completed ()
void
SMFSource::mark_midi_streaming_write_completed (Evoral::Sequence<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;
diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc
index e9e3b00142..618dddc70b 100644
--- a/libs/ardour/source.cc
+++ b/libs/ardour/source.cc
@@ -29,7 +29,7 @@
#include <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
}
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index b0803a9d34..da5980599d 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -50,8 +50,8 @@ using namespace std;
using namespace PBD;
PBD::Signal1<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 {
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index f96bb5a91a..a5016073bb 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -23,7 +23,7 @@
#include <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);
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index 452a0843e2..92e51a4250 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -255,7 +255,7 @@ void
Track::deactivate_visible_processors ()
{
_deactivated_processors.clear ();
- Glib::RWLock::ReaderLock lm (_processor_lock);
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((*i)->active() && (*i)->display_to_user() && boost::dynamic_pointer_cast<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) {
diff --git a/libs/ardour/user_bundle.cc b/libs/ardour/user_bundle.cc
index de71a87d86..2655d6bc7d 100644
--- a/libs/ardour/user_bundle.cc
+++ b/libs/ardour/user_bundle.cc
@@ -90,7 +90,7 @@ ARDOUR::UserBundle::get_state ()
node->add_property ("name", name ());
{
- Glib::Mutex::Lock lm (_channel_mutex);
+ Glib::Threads::Mutex::Lock lm (_channel_mutex);
for (std::vector<Channel>::iterator i = _channel.begin(); i != _channel.end(); ++i) {
XMLNode* c = new XMLNode ("Channel");
diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc
index c108f653c4..290689f13c 100644
--- a/libs/ardour/worker.cc
+++ b/libs/ardour/worker.cc
@@ -26,7 +26,7 @@ namespace ARDOUR {
Worker::Worker(Workee* workee, uint32_t ring_size)
: _workee(workee)
- , _thread(Glib::Thread::create(sigc::mem_fun(*this, &Worker::run), true))
+ , _thread (Glib::Threads::Thread::create(sigc::mem_fun(*this, &Worker::run)))
, _requests(new RingBuffer<uint8_t>(ring_size))
, _responses(new RingBuffer<uint8_t>(ring_size))
, _response((uint8_t*)malloc(ring_size))
diff --git a/libs/audiographer/audiographer/general/threader.h b/libs/audiographer/audiographer/general/threader.h
index 0f4aaff973..d1e11c00e1 100644
--- a/libs/audiographer/audiographer/general/threader.h
+++ b/libs/audiographer/audiographer/general/threader.h
@@ -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;
};
diff --git a/libs/audiographer/tests/test_runner.cc b/libs/audiographer/tests/test_runner.cc
index 6fed393dc8..756a45fd42 100644
--- a/libs/audiographer/tests/test_runner.cc
+++ b/libs/audiographer/tests/test_runner.cc
@@ -1,8 +1,6 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
-#include <glibmm/thread.h>
-
int main()
{
Glib::thread_init();
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp
index 74d4e5b982..ffddd9d6e5 100644
--- a/libs/evoral/evoral/ControlList.hpp
+++ b/libs/evoral/evoral/ControlList.hpp
@@ -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;
diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp
index 8df942b31f..431885112b 100644
--- a/libs/evoral/evoral/ControlSet.hpp
+++ b/libs/evoral/evoral/ControlSet.hpp
@@ -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;
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp
index ab3e3bd41b..cb851cf2f6 100644
--- a/libs/evoral/evoral/Sequence.hpp
+++ b/libs/evoral/evoral/Sequence.hpp
@@ -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) {
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index f25f988ec0..c4495485de 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -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;
diff --git a/libs/evoral/src/ControlSet.cpp b/libs/evoral/src/ControlSet.cpp
index d4480c2897..393b819146 100644
--- a/libs/evoral/src/ControlSet.cpp
+++ b/libs/evoral/src/ControlSet.cpp
@@ -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 ();
diff --git a/libs/evoral/src/Curve.cpp b/libs/evoral/src/Curve.cpp
index 81faee70d3..3f2ee361d3 100644
--- a/libs/evoral/src/Curve.cpp
+++ b/libs/evoral/src/Curve.cpp
@@ -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);
}
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc
index 11b06b78ff..a1b932af59 100644
--- a/libs/gtkmm2ext/gtk_ui.cc
+++ b/libs/gtkmm2ext/gtk_ui.cc
@@ -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
diff --git a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
index 4bf82fb1aa..40137bbbb7 100644
--- a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
+++ b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
@@ -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
diff --git a/libs/midi++2/ipmidi_port.cc b/libs/midi++2/ipmidi_port.cc
index 7e30752c38..c90a3dbe6f 100644
--- a/libs/midi++2/ipmidi_port.cc
+++ b/libs/midi++2/ipmidi_port.cc
@@ -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;
diff --git a/libs/midi++2/jack_midi_port.cc b/libs/midi++2/jack_midi_port.cc
index 9d7fb8c70e..10274ad859 100644
--- a/libs/midi++2/jack_midi_port.cc
+++ b/libs/midi++2/jack_midi_port.cc
@@ -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);
diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h
index 32cf1163e6..ff1691baab 100644
--- a/libs/midi++2/midi++/ipmidi_port.h
+++ b/libs/midi++2/midi++/ipmidi_port.h
@@ -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 ();
diff --git a/libs/midi++2/midi++/jack_midi_port.h b/libs/midi++2/midi++/jack_midi_port.h
index b8d208c77a..a8859387a4 100644
--- a/libs/midi++2/midi++/jack_midi_port.h
+++ b/libs/midi++2/midi++/jack_midi_port.h
@@ -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 ();
diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc
index 14a3ef644d..a7e148c839 100644
--- a/libs/pbd/base_ui.cc
+++ b/libs/pbd/base_ui.cc
@@ -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);
}
diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc
index 3ddbc88e6d..26c8188bde 100644
--- a/libs/pbd/boost_debug.cc
+++ b/libs/pbd/boost_debug.cc
@@ -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";
diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc
index 82a8464c8b..42e015ac6f 100644
--- a/libs/pbd/controllable.cc
+++ b/libs/pbd/controllable.cc
@@ -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) {
diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc
index 6950c045ff..77b08b9f73 100644
--- a/libs/pbd/event_loop.cc
+++ b/libs/pbd/event_loop.cc
@@ -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;
diff --git a/libs/pbd/file_manager.cc b/libs/pbd/file_manager.cc
index 29ef7d6e6e..a71ffca190 100644
--- a/libs/pbd/file_manager.cc
+++ b/libs/pbd/file_manager.cc
@@ -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);
diff --git a/libs/pbd/id.cc b/libs/pbd/id.cc
index 9b04c88e65..24cf02ab2e 100644
--- a/libs/pbd/id.cc
+++ b/libs/pbd/id.cc
@@ -31,14 +31,14 @@
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++;
}
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc
index b300a62dd8..8ebc12a433 100644
--- a/libs/pbd/pbd/abstract_ui.cc
+++ b/libs/pbd/pbd/abstract_ui.cc
@@ -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);
}
diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h
index 7eb2320230..fb09dee5c2 100644
--- a/libs/pbd/pbd/abstract_ui.h
+++ b/libs/pbd/pbd/abstract_ui.h
@@ -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);
diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h
index 65a9f27b49..186a3c55a6 100644
--- a/libs/pbd/pbd/base_ui.h
+++ b/libs/pbd/pbd/base_ui.h
@@ -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
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
index b23cdc7e97..d9cd21d28d 100644
--- a/libs/pbd/pbd/controllable.h
+++ b/libs/pbd/pbd/controllable.h
@@ -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;
};
diff --git a/libs/pbd/pbd/event_loop.h b/libs/pbd/pbd/event_loop.h
index 450bf5752f..b5ee9b8000 100644
--- a/libs/pbd/pbd/event_loop.h
+++ b/libs/pbd/pbd/event_loop.h
@@ -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;
};
diff --git a/libs/pbd/pbd/file_manager.h b/libs/pbd/pbd/file_manager.h
index 01c9a8ee31..14552f9fef 100644
--- a/libs/pbd/pbd/file_manager.h
+++ b/libs/pbd/pbd/file_manager.h
@@ -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
};
diff --git a/libs/pbd/pbd/id.h b/libs/pbd/pbd/id.h
index 6296fc2981..6a9332be53 100644
--- a/libs/pbd/pbd/id.h
+++ b/libs/pbd/pbd/id.h
@@ -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;
};
diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h
index ab06343b4a..fc8454cee7 100644
--- a/libs/pbd/pbd/pool.h
+++ b/libs/pbd/pbd/pool.h
@@ -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;
};
diff --git a/libs/pbd/pbd/rcu.h b/libs/pbd/pbd/rcu.h
index 7b05346294..909954fc0e 100644
--- a/libs/pbd/pbd/rcu.h
+++ b/libs/pbd/pbd/rcu.h
@@ -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;
};
diff --git a/libs/pbd/pbd/sndfile_manager.h b/libs/pbd/pbd/sndfile_manager.h
index 8fd155111b..2167cadf5f 100644
--- a/libs/pbd/pbd/sndfile_manager.h
+++ b/libs/pbd/pbd/sndfile_manager.h
@@ -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"
diff --git a/libs/pbd/pbd/stacktrace.h b/libs/pbd/pbd/stacktrace.h
index 40275fd536..94d07cab96 100644
--- a/libs/pbd/pbd/stacktrace.h
+++ b/libs/pbd/pbd/stacktrace.h
@@ -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
diff --git a/libs/pbd/pbd/stateful.h b/libs/pbd/pbd/stateful.h
index 36c6fe28c7..154e806644 100644
--- a/libs/pbd/pbd/stateful.h
+++ b/libs/pbd/pbd/stateful.h
@@ -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;
diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc
index 0fc542f1dd..7b24625727 100644
--- a/libs/pbd/pool.cc
+++ b/libs/pbd/pool.cc
@@ -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;
diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc
index 92d92da592..e8b5e2690d 100644
--- a/libs/pbd/pthread_utils.cc
+++ b/libs/pbd/pthread_utils.cc
@@ -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 *
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc
index 3e8cd267a5..105af75861 100644
--- a/libs/pbd/stateful.cc
+++ b/libs/pbd/stateful.cc
@@ -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;
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
index 0c7f600e2c..da7340182e 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
@@ -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];
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index d6a75f66f9..e23e8725ae 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -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);
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h
index ee1144a667..a7c420cc41 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h
@@ -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*);
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index 7a9e34195e..080aef1e3d 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -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"
diff --git a/libs/surfaces/mackie/surface_port.h b/libs/surfaces/mackie/surface_port.h
index 70b1df4580..7dc20a06f2 100644
--- a/libs/surfaces/mackie/surface_port.h
+++ b/libs/surfaces/mackie/surface_port.h
@@ -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"
diff --git a/libs/surfaces/tranzport/tranzport_control_protocol.h b/libs/surfaces/tranzport/tranzport_control_protocol.h
index 53d64e8e98..1c318007b0 100644
--- a/libs/surfaces/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/tranzport/tranzport_control_protocol.h
@@ -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];
diff --git a/libs/surfaces/wiimote/wiimote.h b/libs/surfaces/wiimote/wiimote.h
index c7c2cd59c9..4ab19749e5 100644
--- a/libs/surfaces/wiimote/wiimote.h
+++ b/libs/surfaces/wiimote/wiimote.h
@@ -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;
};