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
This commit is contained in:
Paul Davis 2012-07-25 17:48:55 +00:00
parent eb6e352dd0
commit 3cd8138a41
138 changed files with 664 additions and 703 deletions

View File

@ -239,7 +239,7 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
{
track_list_ready = false;
{
Glib::Mutex::Lock lm (track_list_lock);
Glib::Threads::Mutex::Lock lm (track_list_lock);
// Empty track list & free old graphs
clear_tracklist();

View File

@ -35,7 +35,7 @@
#include <gtkmm2ext/dndtreeview.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/session_handle.h"
@ -116,7 +116,7 @@ private:
FFTGraph fft_graph;
bool track_list_ready;
Glib::Mutex track_list_lock;
Glib::Threads::Mutex track_list_lock;
friend class FFTGraph;
};

View File

@ -61,7 +61,7 @@ void
FFTGraph::setWindowSize(int windowSize)
{
if (_a_window) {
Glib::Mutex::Lock lm (_a_window->track_list_lock);
Glib::Threads::Mutex::Lock lm (_a_window->track_list_lock);
setWindowSize_internal(windowSize);
} else {
setWindowSize_internal(windowSize);
@ -268,7 +268,7 @@ FFTGraph::draw_scales(Glib::RefPtr<Gdk::Window> window)
void
FFTGraph::redraw()
{
Glib::Mutex::Lock lm (_a_window->track_list_lock);
Glib::Threads::Mutex::Lock lm (_a_window->track_list_lock);
draw_scales(get_window());

View File

@ -30,7 +30,7 @@
#include "pbd/convert.h"
#include "pbd/unwind.h"
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>

View File

@ -1236,7 +1236,7 @@ ProcessorBox::choose_send ()
/* XXX need processor lock on route */
try {
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock());
send->output()->ensure_io (outs, false, this);
} catch (AudioEngine::PortRegistrationFailure& err) {
error << string_compose (_("Cannot set up new send: %1"), err.what()) << endmsg;

View File

@ -20,7 +20,7 @@
#include <algorithm>
#include <inttypes.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/window_title.h>

View File

@ -187,7 +187,7 @@ void
StripSilenceDialog::update_silence_rects ()
{
/* Lock so that we don't contend with the detection thread for access to the silence regions */
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
double const y = _threshold.get_value();
for (list<ViewInterval>::iterator v = views.begin(); v != views.end(); ++v) {

View File

@ -18,7 +18,7 @@
*/
#include <gtkmm/spinbutton.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/types.h"
#include "ardour_dialog.h"
@ -84,8 +84,8 @@ private:
pthread_t _thread; ///< thread to compute silence in the background
static void * _detection_thread_work (void *);
void * detection_thread_work ();
Glib::Mutex _lock; ///< lock held while the thread is doing work
Glib::Cond _run_cond; ///< condition to wake the thread
Glib::Threads::Mutex _lock; ///< lock held while the thread is doing work
Glib::Threads::Cond _run_cond; ///< condition to wake the thread
bool _thread_should_finish; ///< true if the thread should terminate
PBD::Signal0<void> Completed; ///< emitted when a silence detection has completed
PBD::ScopedConnection _completed_connection;

View File

@ -449,7 +449,7 @@ Amp::GainControl::internal_to_user (double v) const
void
Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes)
{
Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock am (control_lock(), Glib::Threads::TRY_LOCK);
if (am.locked() && _session.transport_rolling() && _gain_control->automation_playback()) {
assert (_gain_automation_buffer);

View File

@ -27,8 +27,8 @@ using namespace ARDOUR;
using namespace PBD;
Analyser* Analyser::the_analyser = 0;
Glib::StaticMutex Analyser::analysis_queue_lock = GLIBMM_STATIC_MUTEX_INIT;
Glib::Cond* Analyser::SourcesToAnalyse = 0;
Glib::Threads::Mutex Analyser::analysis_queue_lock;
Glib::Threads::Cond Analyser::SourcesToAnalyse;
list<boost::weak_ptr<Source> > Analyser::analysis_queue;
Analyser::Analyser ()
@ -49,8 +49,7 @@ analyser_work ()
void
Analyser::init ()
{
SourcesToAnalyse = new Glib::Cond();
Glib::Thread::create (sigc::ptr_fun (analyser_work), false);
Glib::Threads::Thread::create (sigc::ptr_fun (analyser_work));
}
void
@ -64,9 +63,9 @@ Analyser::queue_source_for_analysis (boost::shared_ptr<Source> src, bool force)
return;
}
Glib::Mutex::Lock lm (analysis_queue_lock);
Glib::Threads::Mutex::Lock lm (analysis_queue_lock);
analysis_queue.push_back (boost::weak_ptr<Source>(src));
SourcesToAnalyse->broadcast ();
SourcesToAnalyse.broadcast ();
}
void
@ -79,7 +78,7 @@ Analyser::work ()
wait:
if (analysis_queue.empty()) {
SourcesToAnalyse->wait (analysis_queue_lock);
SourcesToAnalyse.wait (analysis_queue_lock);
}
if (analysis_queue.empty()) {

View File

@ -1,7 +1,7 @@
#ifndef __ardour_analyser_h__
#define __ardour_analyser_h__
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <boost/shared_ptr.hpp>
namespace ARDOUR {
@ -22,8 +22,8 @@ class Analyser {
private:
static Analyser* the_analyser;
static Glib::StaticMutex analysis_queue_lock;
static Glib::Cond* SourcesToAnalyse;
static Glib::Threads::Mutex analysis_queue_lock;
static Glib::Threads::Cond SourcesToAnalyse;
static std::list<boost::weak_ptr<Source> > analysis_queue;
static void analyse_audio_file_source (boost::shared_ptr<AudioFileSource>);

View File

@ -31,7 +31,7 @@
#include <exception>
#include <string>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/rcu.h"
#include "pbd/signals.h"
@ -85,7 +85,7 @@ public:
int start ();
bool running() const { return _running; }
Glib::Mutex& process_lock() { return _process_lock; }
Glib::Threads::Mutex& process_lock() { return _process_lock; }
framecnt_t frame_rate () const;
pframes_t frames_per_cycle () const;
@ -265,8 +265,8 @@ private:
jack_client_t* volatile _jack; /* could be reset to null by SIGPIPE or another thread */
std::string jack_client_name;
Glib::Mutex _process_lock;
Glib::Cond session_removed;
Glib::Threads::Mutex _process_lock;
Glib::Threads::Cond session_removed;
bool session_remove_pending;
frameoffset_t session_removal_countdown;
gain_t session_removal_gain;
@ -286,7 +286,7 @@ private:
bool _pre_freewheel_mmc_enabled;
int _usecs_per_cycle;
bool port_remove_in_progress;
Glib::Thread* m_meter_thread;
Glib::Threads::Thread* m_meter_thread;
ProcessThread* _main_thread;
SerializedRCUManager<Ports> ports;

View File

@ -25,7 +25,7 @@
#include <time.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <boost/function.hpp>
#include "ardour/source.h"
@ -118,7 +118,7 @@ class AudioSource : virtual public Source,
static std::vector<boost::shared_ptr<Sample> > _mixdown_buffers;
static std::vector<boost::shared_ptr<gain_t> > _gain_buffers;
static Glib::StaticMutex _level_buffer_lock;
static Glib::Threads::Mutex _level_buffer_lock;
static void ensure_buffers_for_level (uint32_t, framecnt_t);
static void ensure_buffers_for_level_locked (uint32_t, framecnt_t);
@ -157,7 +157,7 @@ class AudioSource : virtual public Source,
* PeaksReady means that _peaks_built cannot be changed
* during the handling of the signal.
*/
mutable Glib::Mutex _peaks_ready_lock;
mutable Glib::Threads::Mutex _peaks_ready_lock;
PBD::FdFileDescriptor* _peakfile_descriptor;
int _peakfile_fd;

View File

@ -22,7 +22,7 @@
#include <string>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/ardour.h"
#include "ardour/audio_track.h"
@ -62,7 +62,7 @@ class Auditioner : public AudioTrack
boost::shared_ptr<AudioRegion> the_region;
framepos_t current_frame;
mutable gint _auditioning;
Glib::Mutex lock;
Glib::Threads::Mutex lock;
framecnt_t length;
bool via_monitor;

View File

@ -21,7 +21,7 @@
#define __ardour_auto_bundle_h__
#include <vector>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/bundle.h"
namespace ARDOUR {

View File

@ -24,7 +24,7 @@
#include <list>
#include <cmath>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/undo.h"
#include "pbd/xml++.h"

View File

@ -19,7 +19,7 @@
#include <list>
#include <boost/shared_ptr.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <sigc++/signal.h>
#include "pbd/signals.h"
@ -47,10 +47,10 @@ class AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr,
~AutomationWatch();
static AutomationWatch* _instance;
Glib::Thread* _thread;
Glib::Threads::Thread* _thread;
bool _run_thread;
AutomationWatches automation_watches;
Glib::Mutex automation_watch_lock;
Glib::Threads::Mutex automation_watch_lock;
PBD::ScopedConnection transport_connection;
void transport_state_change ();

View File

@ -7,7 +7,7 @@
#include "ardour/chan_count.h"
#include <list>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
namespace ARDOUR {
@ -24,7 +24,7 @@ public:
static void ensure_buffers (ChanCount howmany = ChanCount::ZERO);
private:
static Glib::StaticMutex rb_mutex;
static Glib::Threads::Mutex rb_mutex;
typedef PBD::RingBufferNPT<ThreadBuffers*> ThreadBufferFIFO;
typedef std::list<ThreadBuffers*> ThreadBufferList;

View File

@ -22,7 +22,7 @@
#include <string>
#include <vector>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <boost/shared_ptr.hpp>
#include "pbd/signals.h"
@ -134,7 +134,7 @@ class Bundle : public PBD::ScopedConnectionList
/// mutex for _channel_ports and _channel_names
/// XXX: is this necessary?
mutable Glib::Mutex _channel_mutex;
mutable Glib::Threads::Mutex _channel_mutex;
std::vector<Channel> _channel;
private:

View File

@ -20,7 +20,7 @@
#ifndef __ardour_butler_h__
#define __ardour_butler_h__
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/ringbuffer.h"
#include "pbd/pool.h"
@ -67,8 +67,8 @@ class Butler : public SessionHandleRef
};
pthread_t thread;
Glib::Mutex request_lock;
Glib::Cond paused;
Glib::Threads::Mutex request_lock;
Glib::Threads::Cond paused;
bool should_run;
mutable gint should_do_transport_work;
int request_pipe[2];

View File

@ -24,7 +24,7 @@
#include <list>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/stateful.h"
#include "ardour/session_handle.h"
@ -81,7 +81,7 @@ class ControlProtocolManager : public PBD::Stateful, public ARDOUR::SessionHandl
ControlProtocolManager ();
static ControlProtocolManager* _instance;
Glib::Mutex protocols_lock;
Glib::Threads::Mutex protocols_lock;
std::list<ControlProtocol*> control_protocols;
void session_going_away ();

View File

@ -250,7 +250,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
static framecnt_t disk_io_chunk_frames;
std::vector<CaptureInfo*> capture_info;
mutable Glib::Mutex capture_info_lock;
mutable Glib::Threads::Mutex capture_info_lock;
uint32_t i_am_the_modifier;
@ -301,7 +301,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
bool in_set_state;
Glib::Mutex state_lock;
Glib::Threads::Mutex state_lock;
PBD::ScopedConnectionList playlist_connections;

View File

@ -122,8 +122,8 @@ private:
bool _graph_empty;
// chain swapping
Glib::Mutex _swap_mutex;
Glib::Cond _cleanup_cond;
Glib::Threads::Mutex _swap_mutex;
Glib::Threads::Cond _cleanup_cond;
volatile int _current_chain;
volatile int _pending_chain;
volatile int _setup_chain;

View File

@ -48,7 +48,7 @@ class InternalReturn : public Return
/** sends that we are receiving data from */
std::list<InternalSend*> _sends;
/** mutex to protect _sends */
Glib::Mutex _sends_mutex;
Glib::Threads::Mutex _sends_mutex;
};
} // namespace ARDOUR

View File

@ -25,7 +25,7 @@
#include <cmath>
#include <jack/jack.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/fastlog.h"
#include "pbd/undo.h"
@ -200,7 +200,7 @@ class IO : public SessionObject, public Latent
int set_ports (const std::string& str);
private:
mutable Glib::Mutex io_lock;
mutable Glib::Threads::Mutex io_lock;
protected:
PortSet _ports;

View File

@ -23,7 +23,7 @@
#include <string>
#include <boost/shared_ptr.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/undo.h"

View File

@ -27,7 +27,7 @@
#include <sys/types.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/undo.h"
#include "pbd/stateful.h"
@ -181,12 +181,12 @@ class Locations : public SessionHandleRef, public PBD::StatefulDestructible
PBD::Signal1<void,const PBD::PropertyChange&> StateChanged;
template<class T> void apply (T& obj, void (T::*method)(LocationList&)) {
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
(obj.*method)(locations);
}
template<class T1, class T2> void apply (T1& obj, void (T1::*method)(LocationList&, T2& arg), T2& arg) {
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
(obj.*method)(locations, arg);
}
@ -194,7 +194,7 @@ class Locations : public SessionHandleRef, public PBD::StatefulDestructible
LocationList locations;
Location *current_location;
mutable Glib::Mutex lock;
mutable Glib::Threads::Mutex lock;
int set_current_unlocked (Location *);
void location_changed (Location*);

View File

@ -21,7 +21,7 @@
#define __ardour_logcurve_h__
#include "pbd/fastlog.h"
#include <glibmm/thread.h>
#include <glibmm/threads.h>
namespace ARDOUR {
@ -93,7 +93,7 @@ class LogCurve {
}
void set_length (uint32_t len) { l = len; }
mutable Glib::Mutex lock;
mutable Glib::Threads::Mutex lock;
protected:
float a;

View File

@ -199,7 +199,7 @@ class MidiDiskstream : public Diskstream
the GUI to read (so that it can update itself).
*/
MidiBuffer _gui_feed_buffer;
mutable Glib::Mutex _gui_feed_buffer_mutex;
mutable Glib::Threads::Mutex _gui_feed_buffer_mutex;
};
}; /* namespace ARDOUR */

View File

@ -25,7 +25,7 @@
#include <deque>
#include <utility>
#include <boost/utility.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/command.h"
#include "ardour/types.h"
#include "ardour/midi_buffer.h"
@ -267,14 +267,14 @@ protected:
private:
struct WriteLockImpl : public AutomatableSequence<TimeType>::WriteLockImpl {
WriteLockImpl(Glib::Mutex::Lock* source_lock, Glib::RWLock& s, Glib::Mutex& c)
WriteLockImpl(Glib::Threads::Mutex::Lock* slock, Glib::Threads::RWLock& s, Glib::Threads::Mutex& c)
: AutomatableSequence<TimeType>::WriteLockImpl(s, c)
, source_lock(source_lock)
, source_lock (slock)
{}
~WriteLockImpl() {
delete source_lock;
}
Glib::Mutex::Lock* source_lock;
Glib::Threads::Mutex::Lock* source_lock;
};
public:

View File

@ -22,7 +22,7 @@
#include <string>
#include <time.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <boost/enable_shared_from_this.hpp>
#include "pbd/stateful.h"
#include "pbd/xml++.h"

View File

@ -230,16 +230,16 @@ public:
friend class Session;
protected:
class RegionReadLock : public Glib::RWLock::ReaderLock {
class RegionReadLock : public Glib::Threads::RWLock::ReaderLock {
public:
RegionReadLock (Playlist *pl) : Glib::RWLock::ReaderLock (pl->region_lock) {}
RegionReadLock (Playlist *pl) : Glib::Threads::RWLock::ReaderLock (pl->region_lock) {}
~RegionReadLock() {}
};
class RegionWriteLock : public Glib::RWLock::WriterLock {
class RegionWriteLock : public Glib::Threads::RWLock::WriterLock {
public:
RegionWriteLock (Playlist *pl, bool do_block_notify = true)
: Glib::RWLock::WriterLock (pl->region_lock)
: Glib::Threads::RWLock::WriterLock (pl->region_lock)
, playlist (pl)
, block_notify (do_block_notify) {
if (block_notify) {
@ -248,7 +248,7 @@ public:
}
~RegionWriteLock() {
Glib::RWLock::WriterLock::release ();
Glib::Threads::RWLock::WriterLock::release ();
if (block_notify) {
playlist->release_notifications ();
}
@ -375,7 +375,7 @@ public:
private:
friend class RegionReadLock;
friend class RegionWriteLock;
mutable Glib::RWLock region_lock;
mutable Glib::Threads::RWLock region_lock;
private:
void setup_layering_indices (RegionList const &);

View File

@ -1,7 +1,7 @@
#ifndef __libardour_process_thread__
#define __libardour_process_thread__
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/chan_count.h"
#include "ardour/types.h"
@ -36,7 +36,7 @@ protected:
void session_going_away ();
private:
static Glib::Private<ThreadBuffers>* _private_thread_buffers;
static Glib::Threads::Private<ThreadBuffers> _private_thread_buffers;
};
} // namespace

View File

@ -22,7 +22,7 @@
#include <map>
#include <set>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/id.h"
#include "pbd/property_list.h"
@ -124,11 +124,11 @@ public:
static void region_changed (PBD::PropertyChange const &, boost::weak_ptr<Region>);
static Glib::StaticMutex region_map_lock;
static Glib::Threads::Mutex region_map_lock;
static RegionMap region_map;
static Glib::StaticMutex region_name_maps_mutex;
static Glib::Threads::Mutex region_name_maps_mutex;
/** map of partial region names and suffix numbers */
static std::map<std::string, uint32_t> region_name_number_map;
/** map of complete region names with their region ID */

View File

@ -32,7 +32,7 @@
#include <boost/dynamic_bitset.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/fastlog.h"
#include "pbd/xml++.h"
#include "pbd/undo.h"
@ -191,7 +191,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
void flush_processors ();
void foreach_processor (boost::function<void(boost::weak_ptr<Processor>)> method) {
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<UnknownProcessor> (*i)) {
break;
@ -201,7 +201,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
}
boost::shared_ptr<Processor> nth_processor (uint32_t n) {
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator i;
for (i = _processors.begin(); i != _processors.end() && n; ++i, --n) {}
if (i == _processors.end()) {
@ -468,7 +468,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
framecnt_t _roll_delay;
ProcessorList _processors;
mutable Glib::RWLock _processor_lock;
mutable Glib::Threads::RWLock _processor_lock;
boost::shared_ptr<Delivery> _main_outs;
boost::shared_ptr<InternalSend> _monitor_send;
boost::shared_ptr<InternalReturn> _intreturn;

View File

@ -34,7 +34,7 @@
#include <boost/weak_ptr.hpp>
#include <boost/utility.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/error.h"
#include "pbd/event_loop.h"
@ -1258,7 +1258,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/* REGION MANAGEMENT */
mutable Glib::Mutex region_lock;
mutable Glib::Threads::Mutex region_lock;
int load_regions (const XMLNode& node);
int load_compounds (const XMLNode& node);
@ -1269,7 +1269,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/* SOURCES */
mutable Glib::Mutex source_lock;
mutable Glib::Threads::Mutex source_lock;
public:
typedef std::map<PBD::ID,boost::shared_ptr<Source> > SourceMap;
@ -1354,7 +1354,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
could not report free space.
*/
bool _total_free_4k_blocks_uncertain;
Glib::Mutex space_lock;
Glib::Threads::Mutex space_lock;
bool no_questions_about_missing_files;
@ -1397,7 +1397,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
Sample* click_emphasis_data;
framecnt_t click_length;
framecnt_t click_emphasis_length;
mutable Glib::RWLock click_lock;
mutable Glib::Threads::RWLock click_lock;
static const Sample default_click[];
static const framecnt_t default_click_length;
@ -1450,7 +1450,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
int find_all_sources_across_snapshots (std::set<std::string>& result, bool exclude_this_snapshot);
typedef std::set<boost::shared_ptr<PBD::Controllable> > Controllables;
Glib::Mutex controllables_lock;
Glib::Threads::Mutex controllables_lock;
Controllables controllables;
boost::shared_ptr<PBD::Controllable> _solo_cut_control;

View File

@ -29,7 +29,7 @@ namespace ARDOUR {
template<class T> void
SessionPlaylists::foreach (T *obj, void (T::*func)(boost::shared_ptr<Playlist>))
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::iterator i = playlists.begin(); i != playlists.end(); i++) {
if (!(*i)->hidden()) {
(obj->*func) (*i);

View File

@ -23,7 +23,7 @@
#include <set>
#include <vector>
#include <string>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
@ -78,7 +78,7 @@ private:
int load_unused (Session &, const XMLNode&);
boost::shared_ptr<Playlist> XMLPlaylistFactory (Session &, const XMLNode&);
mutable Glib::Mutex lock;
mutable Glib::Threads::Mutex lock;
typedef std::set<boost::shared_ptr<Playlist> > List;
List playlists;
List unused_playlists;

View File

@ -22,7 +22,7 @@
#include <iostream>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/session.h"
#include "ardour/route.h"

View File

@ -22,7 +22,7 @@
#include <vector>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <jack/jack.h>
@ -262,7 +262,7 @@ class MTC_Slave : public Slave {
size_t speed_accumulator_cnt;
bool have_first_speed_accumulator;
double average_speed;
Glib::Mutex reset_lock;
Glib::Threads::Mutex reset_lock;
uint32_t reset_pending;
bool reset_position;

View File

@ -23,7 +23,7 @@
#include <string>
#include <set>
#include <glib.h>
#include <glibmm/threads.h>
#include <boost/utility.hpp>
#include "pbd/statefuldestructible.h"
@ -99,7 +99,7 @@ class Source : public SessionObject
void set_allow_remove_if_empty (bool yn);
Glib::Mutex& mutex() { return _lock; }
Glib::Threads::Mutex& mutex() { return _lock; }
Flag flags() const { return _flags; }
virtual void inc_use_count ();
@ -114,8 +114,8 @@ class Source : public SessionObject
time_t _timestamp;
framepos_t _timeline_position;
bool _analysed;
mutable Glib::Mutex _lock;
mutable Glib::Mutex _analysis_lock;
mutable Glib::Threads::Mutex _lock;
mutable Glib::Threads::Mutex _analysis_lock;
gint _use_count; /* atomic */
uint32_t _level; /* how deeply nested is this source w.r.t a disk file */

View File

@ -24,6 +24,8 @@
#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <glibmm/threads.h>
#include "ardour/source.h"
class XMLNode;
@ -59,8 +61,8 @@ class SourceFactory {
(DataType type, Session& s, boost::shared_ptr<Playlist> p, const PBD::ID& orig, const std::string& name,
uint32_t chn, frameoffset_t start, framecnt_t len, bool copy, bool defer_peaks);
static Glib::Cond* PeaksToBuild;
static Glib::StaticMutex peak_building_lock;
static Glib::Threads::Cond PeaksToBuild;
static Glib::Threads::Mutex peak_building_lock;
static std::list< boost::weak_ptr<AudioSource> > files_with_peaks;
static int setup_peakfile (boost::shared_ptr<Source>, bool async);

View File

@ -24,7 +24,7 @@
#include <string>
#include <vector>
#include <cmath>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/undo.h"
#include "pbd/stateful.h"
@ -218,7 +218,7 @@ class TempoMap : public PBD::StatefulDestructible
typedef std::vector<BBTPoint> BBTPointList;
template<class T> void apply_with_metrics (T& obj, void (T::*method)(const Metrics&)) {
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
(obj.*method)(metrics);
}
@ -314,7 +314,7 @@ class TempoMap : public PBD::StatefulDestructible
Metrics metrics;
framecnt_t _frame_rate;
mutable Glib::RWLock lock;
mutable Glib::Threads::RWLock lock;
BBTPointList _map;
void recompute_map (bool reassign_tempo_bbt, framepos_t end = -1);

View File

@ -1,7 +1,7 @@
#ifndef __libardour_thread_buffers__
#define __libardour_thread_buffers__
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/chan_count.h"
#include "ardour/types.h"

View File

@ -21,7 +21,7 @@
#define __ardour_user_bundle_h__
#include <vector>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/stateful.h"
#include "ardour/bundle.h"

View File

@ -22,7 +22,7 @@
#include <stdint.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/ringbuffer.h"
#include "pbd/semaphore.h"
@ -76,13 +76,13 @@ public:
private:
void run();
Workee* _workee;
Glib::Thread* _thread;
RingBuffer<uint8_t>* _requests;
RingBuffer<uint8_t>* _responses;
uint8_t* _response;
PBD::Semaphore _sem;
bool _exit;
Workee* _workee;
Glib::Threads::Thread* _thread;
RingBuffer<uint8_t>* _requests;
RingBuffer<uint8_t>* _responses;
uint8_t* _response;
PBD::Semaphore _sem;
bool _exit;
};
} // namespace ARDOUR

View File

@ -151,7 +151,7 @@ void
AudioDiskstream::non_realtime_input_change ()
{
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
if (input_change_pending.type == IOChange::NoChange) {
return;
@ -430,7 +430,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecn
return 0;
}
Glib::Mutex::Lock sm (state_lock, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock sm (state_lock, Glib::Threads::TRY_LOCK);
if (!sm.locked()) {
return 1;
@ -812,7 +812,7 @@ AudioDiskstream::seek (framepos_t frame, bool complete_refill)
ChannelList::iterator chan;
boost::shared_ptr<ChannelList> c = channels.reader();
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
(*chan)->playback_buf->reset ();
@ -1379,7 +1379,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
}
/* XXX is there anything we can do if err != 0 ? */
Glib::Mutex::Lock lm (capture_info_lock);
Glib::Threads::Mutex::Lock lm (capture_info_lock);
if (capture_info.empty()) {
return;

View File

@ -151,7 +151,7 @@ AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cn
with any changes to the list of buffers caused
by creating new nested playlists/sources
*/
Glib::Mutex::Lock lm (_level_buffer_lock);
Glib::Threads::Mutex::Lock lm (_level_buffer_lock);
sbuf = _mixdown_buffers[_level-1];
gbuf = _gain_buffers[_level-1];
}

View File

@ -310,7 +310,7 @@ AudioTrack::set_state_part_two ()
int
AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
@ -483,7 +483,7 @@ AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nfram
boost::scoped_array<Sample> mix_buffer (new Sample[nframes]);
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
Glib::RWLock::ReaderLock rlock (_processor_lock);
Glib::Threads::RWLock::ReaderLock rlock (_processor_lock);
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(diskstream->playlist());
@ -557,7 +557,7 @@ AudioTrack::bounceable (boost::shared_ptr<Processor> endpoint, bool include_endp
return true;
}
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
uint32_t naudio = n_inputs().n_audio();
for (ProcessorList::const_iterator r = _processors.begin(); r != _processors.end(); ++r) {
@ -666,7 +666,7 @@ AudioTrack::freeze_me (InterThreadInfo& itt)
_freeze_record.processor_info.clear ();
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) {
@ -729,7 +729,7 @@ AudioTrack::unfreeze ()
audio_diskstream()->use_playlist (_freeze_record.playlist);
{
Glib::RWLock::ReaderLock lm (_processor_lock); // should this be a write lock? jlc
Glib::Threads::RWLock::ReaderLock lm (_processor_lock); // should this be a write lock? jlc
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
for (vector<FreezeRecordProcessorInfo*>::iterator ii = _freeze_record.processor_info.begin(); ii != _freeze_record.processor_info.end(); ++ii) {
if ((*ii)->id == (*i)->id()) {

View File

@ -31,7 +31,7 @@
#include "pbd/pathscanner.h"
#include "pbd/locale_guard.h"
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>

View File

@ -94,7 +94,7 @@ AudioEngine::AudioEngine (string client_name, string session_uuid)
AudioEngine::~AudioEngine ()
{
{
Glib::Mutex::Lock tm (_process_lock);
Glib::Threads::Mutex::Lock tm (_process_lock);
session_removed.signal ();
if (_running) {
@ -453,7 +453,7 @@ int
AudioEngine::process_callback (pframes_t nframes)
{
GET_PRIVATE_JACK_POINTER_RET(_jack,0);
Glib::Mutex::Lock tm (_process_lock, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock tm (_process_lock, Glib::Threads::TRY_LOCK);
PT_TIMING_REF;
PT_TIMING_CHECK (1);
@ -714,7 +714,7 @@ AudioEngine::jack_bufsize_callback (pframes_t nframes)
}
{
Glib::Mutex::Lock lm (_process_lock);
Glib::Threads::Mutex::Lock lm (_process_lock);
boost::shared_ptr<Ports> p = ports.reader();
@ -745,8 +745,7 @@ AudioEngine::start_metering_thread ()
{
if (m_meter_thread == 0) {
g_atomic_int_set (&m_meter_exit, 0);
m_meter_thread = Glib::Thread::create (boost::bind (&AudioEngine::meter_thread, this),
500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
m_meter_thread = Glib::Threads::Thread::create (boost::bind (&AudioEngine::meter_thread, this));
}
}
@ -767,7 +766,7 @@ AudioEngine::meter_thread ()
void
AudioEngine::set_session (Session *s)
{
Glib::Mutex::Lock pl (_process_lock);
Glib::Threads::Mutex::Lock pl (_process_lock);
SessionHandlePtr::set_session (s);
@ -805,7 +804,7 @@ AudioEngine::set_session (Session *s)
void
AudioEngine::remove_session ()
{
Glib::Mutex::Lock lm (_process_lock);
Glib::Threads::Mutex::Lock lm (_process_lock);
if (_running) {
@ -1391,7 +1390,7 @@ AudioEngine::disconnect_from_jack ()
}
{
Glib::Mutex::Lock lm (_process_lock);
Glib::Threads::Mutex::Lock lm (_process_lock);
jack_client_close (_priv_jack);
_jack = 0;
}

View File

@ -42,7 +42,7 @@
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/audiofilesource.h"
#include "ardour/debug.h"
@ -86,7 +86,7 @@ struct SizedSampleBuffer {
}
};
Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT;
Glib::Threads::Private<SizedSampleBuffer> thread_interleave_buffer;
/** Constructor used for existing external-to-session files. */
AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags)

View File

@ -26,7 +26,7 @@
#include <boost/scoped_array.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/basename.h"
#include "pbd/xml++.h"

View File

@ -46,7 +46,7 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
Glib::StaticMutex AudioSource::_level_buffer_lock = GLIBMM_STATIC_MUTEX_INIT;
Glib::Threads::Mutex AudioSource::_level_buffer_lock;
vector<boost::shared_ptr<Sample> > AudioSource::_mixdown_buffers;
vector<boost::shared_ptr<gain_t> > AudioSource::_gain_buffers;
size_t AudioSource::_working_buffers_size = 0;
@ -160,7 +160,7 @@ bool
AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, ScopedConnection** connect_here_if_not, EventLoop* event_loop) const
{
bool ret;
Glib::Mutex::Lock lm (_peaks_ready_lock);
Glib::Threads::Mutex::Lock lm (_peaks_ready_lock);
if (!(ret = _peaks_built)) {
*connect_here_if_not = new ScopedConnection;
@ -281,14 +281,14 @@ AudioSource::read (Sample *dst, framepos_t start, framecnt_t cnt, int /*channel*
{
assert (cnt >= 0);
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
return read_unlocked (dst, start, cnt);
}
framecnt_t
AudioSource::write (Sample *dst, framecnt_t cnt)
{
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
/* any write makes the fill not removable */
_flags = Flag (_flags & ~Removable);
return write_unlocked (dst, cnt);
@ -308,7 +308,7 @@ int
AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t start, framecnt_t cnt,
double samples_per_visual_peak, framecnt_t samples_per_file_peak) const
{
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
double scale;
double expected_peaks;
PeakData::PeakDatum xmax;
@ -646,7 +646,7 @@ AudioSource::build_peaks_from_scratch ()
{
/* hold lock while building peaks */
Glib::Mutex::Lock lp (_lock);
Glib::Threads::Mutex::Lock lp (_lock);
if (prepare_for_peakfile_writes ()) {
goto out;
@ -717,7 +717,7 @@ AudioSource::done_with_peakfile_writes (bool done)
}
if (done) {
Glib::Mutex::Lock lm (_peaks_ready_lock);
Glib::Threads::Mutex::Lock lm (_peaks_ready_lock);
_peaks_built = true;
PeaksReady (); /* EMIT SIGNAL */
}
@ -777,7 +777,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, framecnt_t first_frame, frame
_peak_byte_max = max (_peak_byte_max, (off_t) (byte + sizeof(PeakData)));
{
Glib::Mutex::Lock lm (_peaks_ready_lock);
Glib::Threads::Mutex::Lock lm (_peaks_ready_lock);
PeakRangeReady (peak_leftover_frame, peak_leftover_cnt); /* EMIT SIGNAL */
if (intermediate_peaks_ready) {
PeaksReady (); /* EMIT SIGNAL */
@ -890,7 +890,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, framecnt_t first_frame, frame
_peak_byte_max = max (_peak_byte_max, (off_t) (first_peak_byte + sizeof(PeakData)*peaks_computed));
if (frames_done) {
Glib::Mutex::Lock lm (_peaks_ready_lock);
Glib::Threads::Mutex::Lock lm (_peaks_ready_lock);
PeakRangeReady (first_frame, frames_done); /* EMIT SIGNAL */
if (intermediate_peaks_ready) {
PeaksReady (); /* EMIT SIGNAL */
@ -948,7 +948,7 @@ AudioSource::available_peaks (double zoom_factor) const
void
AudioSource::mark_streaming_write_completed ()
{
Glib::Mutex::Lock lm (_peaks_ready_lock);
Glib::Threads::Mutex::Lock lm (_peaks_ready_lock);
if (_peaks_built) {
PeaksReady (); /* EMIT SIGNAL */
@ -958,7 +958,7 @@ AudioSource::mark_streaming_write_completed ()
void
AudioSource::allocate_working_buffers (framecnt_t framerate)
{
Glib::Mutex::Lock lm (_level_buffer_lock);
Glib::Threads::Mutex::Lock lm (_level_buffer_lock);
/* Note: we don't need any buffers allocated until
@ -975,7 +975,7 @@ AudioSource::allocate_working_buffers (framecnt_t framerate)
void
AudioSource::ensure_buffers_for_level (uint32_t level, framecnt_t frame_rate)
{
Glib::Mutex::Lock lm (_level_buffer_lock);
Glib::Threads::Mutex::Lock lm (_level_buffer_lock);
ensure_buffers_for_level_locked (level, frame_rate);
}

View File

@ -17,7 +17,7 @@
*/
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/error.h"
@ -136,7 +136,7 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
return;
}
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
/* copy it */
@ -154,7 +154,7 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
ProcessorStreams ps;
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors (&ps)) {
error << string_compose (_("Cannot setup auditioner processing flow for %1 channels"),

View File

@ -16,7 +16,7 @@ ARDOUR::AutoBundle::AutoBundle (std::string const & n, bool i)
ARDOUR::ChanCount
ARDOUR::AutoBundle::nchannels () const
{
Glib::Mutex::Lock lm (_ports_mutex);
Glib::Threads::Mutex::Lock lm (_ports_mutex);
return ChanCount (type(), _ports.size ());
}
@ -25,14 +25,14 @@ ARDOUR::AutoBundle::channel_ports (uint32_t c) const
{
assert (c < nchannels().get (type()));
Glib::Mutex::Lock lm (_ports_mutex);
Glib::Threads::Mutex::Lock lm (_ports_mutex);
return _ports[c];
}
void
ARDOUR::AutoBundle::set_channels (uint32_t n)
{
Glib::Mutex::Lock lm (_ports_mutex);
Glib::Threads::Mutex::Lock lm (_ports_mutex);
_ports.resize (n);
}
@ -41,7 +41,7 @@ ARDOUR::AutoBundle::set_port (uint32_t c, std::string const & p)
{
assert (c < nchannels ().get (type()));
Glib::Mutex::Lock lm (_ports_mutex);
Glib::Threads::Mutex::Lock lm (_ports_mutex);
_ports[c].resize (1);
_ports[c][0] = p;
}

View File

@ -54,7 +54,7 @@ Automatable::Automatable (const Automatable& other)
: ControlSet (other)
, _a_session (other._a_session)
{
Glib::Mutex::Lock lm (other._control_lock);
Glib::Threads::Mutex::Lock lm (other._control_lock);
for (Controls::const_iterator i = other._controls.begin(); i != other._controls.end(); ++i) {
boost::shared_ptr<Evoral::Control> ac (control_factory (i->first));
@ -65,7 +65,7 @@ Automatable::Automatable (const Automatable& other)
Automatable::~Automatable ()
{
{
Glib::Mutex::Lock lm (_control_lock);
Glib::Threads::Mutex::Lock lm (_control_lock);
for (Controls::const_iterator li = _controls.begin(); li != _controls.end(); ++li) {
boost::dynamic_pointer_cast<AutomationControl>(li->second)->drop_references ();
@ -106,7 +106,7 @@ Automatable::load_automation (const string& path)
return 1;
}
Glib::Mutex::Lock lm (control_lock());
Glib::Threads::Mutex::Lock lm (control_lock());
set<Evoral::Parameter> tosave;
controls().clear ();
@ -186,7 +186,7 @@ Automatable::can_automate (Evoral::Parameter what)
int
Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter legacy_param)
{
Glib::Mutex::Lock lm (control_lock());
Glib::Threads::Mutex::Lock lm (control_lock());
/* Don't clear controls, since some may be special derived Controllable classes */
@ -240,7 +240,7 @@ Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter le
XMLNode&
Automatable::get_automation_xml_state ()
{
Glib::Mutex::Lock lm (control_lock());
Glib::Threads::Mutex::Lock lm (control_lock());
XMLNode* node = new XMLNode (Automatable::xml_node_name);
if (controls().empty()) {
@ -260,7 +260,7 @@ Automatable::get_automation_xml_state ()
void
Automatable::set_parameter_automation_state (Evoral::Parameter param, AutoState s)
{
Glib::Mutex::Lock lm (control_lock());
Glib::Threads::Mutex::Lock lm (control_lock());
boost::shared_ptr<AutomationControl> c = automation_control (param, true);
@ -287,7 +287,7 @@ Automatable::get_parameter_automation_state (Evoral::Parameter param)
void
Automatable::set_parameter_automation_style (Evoral::Parameter param, AutoStyle s)
{
Glib::Mutex::Lock lm (control_lock());
Glib::Threads::Mutex::Lock lm (control_lock());
boost::shared_ptr<AutomationControl> c = automation_control(param, true);
@ -300,7 +300,7 @@ Automatable::set_parameter_automation_style (Evoral::Parameter param, AutoStyle
AutoStyle
Automatable::get_parameter_automation_style (Evoral::Parameter param)
{
Glib::Mutex::Lock lm (control_lock());
Glib::Threads::Mutex::Lock lm (control_lock());
boost::shared_ptr<Evoral::Control> c = control(param);
boost::shared_ptr<AutomationList> l = boost::dynamic_pointer_cast<AutomationList>(c->list());

View File

@ -57,14 +57,14 @@ AutomationWatch::~AutomationWatch ()
_thread = 0;
}
Glib::Mutex::Lock lm (automation_watch_lock);
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
automation_watches.clear ();
}
void
AutomationWatch::add_automation_watch (boost::shared_ptr<AutomationControl> ac)
{
Glib::Mutex::Lock lm (automation_watch_lock);
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
DEBUG_TRACE (DEBUG::Automation, string_compose ("now watching control %1 for automation\n", ac->name()));
automation_watches.push_back (ac);
@ -102,7 +102,7 @@ AutomationWatch::remove_weak_automation_watch (boost::weak_ptr<AutomationControl
void
AutomationWatch::remove_automation_watch (boost::shared_ptr<AutomationControl> ac)
{
Glib::Mutex::Lock lm (automation_watch_lock);
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
DEBUG_TRACE (DEBUG::Automation, string_compose ("remove control %1 from automation watch\n", ac->name()));
automation_watches.remove (ac);
ac->list()->set_in_write_pass (false);
@ -116,7 +116,7 @@ AutomationWatch::timer ()
}
{
Glib::Mutex::Lock lm (automation_watch_lock);
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
framepos_t time = _session->audible_frame ();
@ -154,8 +154,7 @@ AutomationWatch::set_session (Session* s)
if (_session) {
_run_thread = true;
_thread = Glib::Thread::create (boost::bind (&AutomationWatch::thread, this),
500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
_thread = Glib::Threads::Thread::create (boost::bind (&AutomationWatch::thread, this));
_session->TransportStateChange.connect_same_thread (transport_connection, boost::bind (&AutomationWatch::transport_state_change, this));
}
@ -171,7 +170,7 @@ AutomationWatch::transport_state_change ()
bool rolling = _session->transport_rolling();
{
Glib::Mutex::Lock lm (automation_watch_lock);
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {
DEBUG_TRACE (DEBUG::Automation, string_compose ("%1: transport state changed, speed %2, in write pass ? %3 writing ? %4\n",

View File

@ -29,7 +29,7 @@ using namespace PBD;
RingBufferNPT<ThreadBuffers*>* BufferManager::thread_buffers = 0;
std::list<ThreadBuffers*>* BufferManager::thread_buffers_list = 0;
Glib::StaticMutex BufferManager::rb_mutex = GLIBMM_STATIC_MUTEX_INIT;
Glib::Threads::Mutex BufferManager::rb_mutex;
using std::cerr;
using std::endl;
@ -55,7 +55,7 @@ BufferManager::init (uint32_t size)
ThreadBuffers*
BufferManager::get_thread_buffers ()
{
Glib::Mutex::Lock em (rb_mutex);
Glib::Threads::Mutex::Lock em (rb_mutex);
ThreadBuffers* tbp;
if (thread_buffers->read (&tbp, 1) == 1) {
@ -69,7 +69,7 @@ BufferManager::get_thread_buffers ()
void
BufferManager::put_thread_buffers (ThreadBuffers* tbp)
{
Glib::Mutex::Lock em (rb_mutex);
Glib::Threads::Mutex::Lock em (rb_mutex);
thread_buffers->write (&tbp, 1);
// cerr << "Put back thread buffers, readable count now " << thread_buffers->read_space() << endl;
}

View File

@ -67,7 +67,7 @@ Bundle::Bundle (boost::shared_ptr<Bundle> other)
ChanCount
Bundle::nchannels () const
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
ChanCount c;
for (vector<Channel>::const_iterator i = _channel.begin(); i != _channel.end(); ++i) {
@ -82,7 +82,7 @@ Bundle::channel_ports (uint32_t c) const
{
assert (c < nchannels().n_total());
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
return _channel[c].ports;
}
@ -97,7 +97,7 @@ Bundle::add_port_to_channel (uint32_t ch, string portname)
assert (portname.find_first_of (':') != string::npos);
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel[ch].ports.push_back (portname);
}
@ -116,7 +116,7 @@ Bundle::remove_port_from_channel (uint32_t ch, string portname)
bool changed = false;
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
PortList& pl = _channel[ch].ports;
PortList::iterator i = find (pl.begin(), pl.end(), portname);
@ -142,7 +142,7 @@ Bundle::set_port (uint32_t ch, string portname)
assert (portname.find_first_of (':') != string::npos);
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel[ch].ports.clear ();
_channel[ch].ports.push_back (portname);
}
@ -155,7 +155,7 @@ void
Bundle::add_channel (std::string const & n, DataType t)
{
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel.push_back (Channel (n, t));
}
@ -167,7 +167,7 @@ void
Bundle::add_channel (std::string const & n, DataType t, PortList p)
{
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel.push_back (Channel (n, t, p));
}
@ -179,7 +179,7 @@ void
Bundle::add_channel (std::string const & n, DataType t, std::string const & p)
{
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel.push_back (Channel (n, t, p));
}
@ -191,7 +191,7 @@ Bundle::port_attached_to_channel (uint32_t ch, std::string portname)
{
assert (ch < nchannels().n_total());
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
return (std::find (_channel[ch].ports.begin (), _channel[ch].ports.end (), portname) != _channel[ch].ports.end ());
}
@ -203,7 +203,7 @@ Bundle::remove_channel (uint32_t ch)
{
assert (ch < nchannels().n_total());
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel.erase (_channel.begin () + ch);
}
@ -211,7 +211,7 @@ Bundle::remove_channel (uint32_t ch)
void
Bundle::remove_channels ()
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel.clear ();
}
@ -222,7 +222,7 @@ Bundle::remove_channels ()
bool
Bundle::offers_port (std::string p) const
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
for (std::vector<Channel>::const_iterator i = _channel.begin(); i != _channel.end(); ++i) {
for (PortList::const_iterator j = i->ports.begin(); j != i->ports.end(); ++j) {
@ -241,7 +241,7 @@ Bundle::offers_port (std::string p) const
bool
Bundle::offers_port_alone (std::string p) const
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
for (std::vector<Channel>::const_iterator i = _channel.begin(); i != _channel.end(); ++i) {
if (i->ports.size() == 1 && i->ports[0] == p) {
@ -261,7 +261,7 @@ Bundle::channel_name (uint32_t ch) const
{
assert (ch < nchannels().n_total());
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
return _channel[ch].name;
}
@ -275,7 +275,7 @@ Bundle::set_channel_name (uint32_t ch, std::string const & n)
assert (ch < nchannels().n_total());
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel[ch].name = n;
}
@ -351,7 +351,7 @@ void
Bundle::remove_ports_from_channels ()
{
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
for (uint32_t c = 0; c < _channel.size(); ++c) {
_channel[c].ports.clear ();
}
@ -370,7 +370,7 @@ Bundle::remove_ports_from_channel (uint32_t ch)
assert (ch < nchannels().n_total());
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
_channel[ch].ports.clear ();
}
@ -517,7 +517,7 @@ Bundle::channel_type (uint32_t c) const
{
assert (c < nchannels().n_total());
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
return _channel[c].type;
}
@ -564,7 +564,7 @@ Bundle::type_channel_to_overall (DataType t, uint32_t c) const
return c;
}
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
vector<Channel>::const_iterator i = _channel.begin ();
@ -598,7 +598,7 @@ Bundle::overall_channel_to_type (DataType t, uint32_t c) const
return c;
}
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
uint32_t s = 0;

View File

@ -311,7 +311,7 @@ restart:
{
Glib::Mutex::Lock lm (request_lock);
Glib::Threads::Mutex::Lock lm (request_lock);
if (should_run && (disk_work_outstanding || transport_work_requested())) {
// for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
@ -349,7 +349,7 @@ Butler::summon ()
void
Butler::stop ()
{
Glib::Mutex::Lock lm (request_lock);
Glib::Threads::Mutex::Lock lm (request_lock);
char c = Request::Pause;
(void) ::write (request_pipe[1], &c, 1);
paused.wait(request_lock);
@ -358,7 +358,7 @@ Butler::stop ()
void
Butler::wait_until_finished ()
{
Glib::Mutex::Lock lm (request_lock);
Glib::Threads::Mutex::Lock lm (request_lock);
char c = Request::Pause;
(void) ::write (request_pipe[1], &c, 1);
paused.wait(request_lock);

View File

@ -46,7 +46,7 @@ ControlProtocolManager::ControlProtocolManager ()
ControlProtocolManager::~ControlProtocolManager()
{
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocol*>::iterator i = control_protocols.begin(); i != control_protocols.end(); ++i) {
delete (*i);
@ -68,7 +68,7 @@ ControlProtocolManager::set_session (Session* s)
SessionHandlePtr::set_session (s);
if (_session) {
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
if ((*i)->requested || (*i)->mandatory) {
@ -97,7 +97,7 @@ ControlProtocolManager::session_going_away()
SessionHandlePtr::session_going_away ();
{
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocol*>::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) {
delete *p;
@ -160,7 +160,7 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
cpi.descriptor->destroy (cpi.descriptor, cpi.protocol);
{
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
list<ControlProtocol*>::iterator p = find (control_protocols.begin(), control_protocols.end(), cpi.protocol);
if (p != control_protocols.end()) {
control_protocols.erase (p);
@ -183,7 +183,7 @@ ControlProtocolManager::load_mandatory_protocols ()
return;
}
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
if ((*i)->mandatory && ((*i)->protocol == 0)) {
@ -319,7 +319,7 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/)
XMLNodeConstIterator citer;
XMLProperty* prop;
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
clist = node.children();
@ -357,7 +357,7 @@ XMLNode&
ControlProtocolManager::get_state ()
{
XMLNode* root = new XMLNode (state_node_name);
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
@ -426,7 +426,7 @@ ControlProtocolManager::instance ()
void
ControlProtocolManager::midi_connectivity_established ()
{
Glib::Mutex::Lock lm (protocols_lock);
Glib::Threads::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocol*>::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) {
(*p)->midi_connectivity_established ();

View File

@ -31,7 +31,7 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/error.h"
#include "pbd/basename.h"
@ -171,7 +171,7 @@ Diskstream::set_track (Track* t)
void
Diskstream::handle_input_change (IOChange change, void * /*src*/)
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
if (change.type & (IOChange::ConfigurationChanged|IOChange::ConnectionsChanged)) {
@ -193,7 +193,7 @@ Diskstream::non_realtime_set_speed ()
{
if (_buffer_reallocation_required)
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
allocate_temporary_buffers ();
_buffer_reallocation_required = false;
@ -315,7 +315,7 @@ Diskstream::set_loop (Location *location)
ARDOUR::framepos_t
Diskstream::get_capture_start_frame (uint32_t n) const
{
Glib::Mutex::Lock lm (capture_info_lock);
Glib::Threads::Mutex::Lock lm (capture_info_lock);
if (capture_info.size() > n) {
/* this is a completed capture */
@ -329,7 +329,7 @@ Diskstream::get_capture_start_frame (uint32_t n) const
ARDOUR::framecnt_t
Diskstream::get_captured_frames (uint32_t n) const
{
Glib::Mutex::Lock lm (capture_info_lock);
Glib::Threads::Mutex::Lock lm (capture_info_lock);
if (capture_info.size() > n) {
/* this is a completed capture */
@ -356,7 +356,7 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
bool prior_playlist = false;
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
if (playlist == _playlist) {
return 0;

View File

@ -36,7 +36,7 @@
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/data_type.h"
#include "ardour/file_source.h"
@ -519,7 +519,7 @@ out:
int
FileSource::set_source_name (const string& newname, bool destructive)
{
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
string oldpath = _path;
string newpath = _session.change_source_path_by_name (oldpath, _name, newname, destructive);

View File

@ -101,7 +101,7 @@ Graph::reset_thread_list ()
return;
}
Glib::Mutex::Lock lm (_session.engine().process_lock());
Glib::Threads::Mutex::Lock lm (_session.engine().process_lock());
pthread_t a_thread;
if (!_thread_list.empty()) {
@ -162,7 +162,7 @@ Graph::drop_threads ()
void
Graph::clear_other_chain ()
{
Glib::Mutex::Lock ls (_swap_mutex);
Glib::Threads::Mutex::Lock ls (_swap_mutex);
while (1) {
if (_setup_chain != _pending_chain) {
@ -275,7 +275,7 @@ Graph::restart_cycle()
void
Graph::rechain (boost::shared_ptr<RouteList> routelist, GraphEdges const & edges)
{
Glib::Mutex::Lock ls (_swap_mutex);
Glib::Threads::Mutex::Lock ls (_swap_mutex);
int chain = _setup_chain;
DEBUG_TRACE (DEBUG::Graph, string_compose ("============== setup %1\n", chain));

View File

@ -16,7 +16,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/internal_return.h"
#include "ardour/internal_send.h"
@ -37,7 +37,7 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e
return;
}
Glib::Mutex::Lock lm (_sends_mutex, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock lm (_sends_mutex, Glib::Threads::TRY_LOCK);
if (lm.locked ()) {
for (list<InternalSend*>::iterator i = _sends.begin(); i != _sends.end(); ++i) {
@ -53,14 +53,14 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e
void
InternalReturn::add_send (InternalSend* send)
{
Glib::Mutex::Lock lm (_sends_mutex);
Glib::Threads::Mutex::Lock lm (_sends_mutex);
_sends.push_back (send);
}
void
InternalReturn::remove_send (InternalSend* send)
{
Glib::Mutex::Lock lm (_sends_mutex);
Glib::Threads::Mutex::Lock lm (_sends_mutex);
_sends.remove (send);
}

View File

@ -25,7 +25,7 @@
#include <errno.h>
#include <glibmm.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/xml++.h"
#include "pbd/replace_all.h"
@ -44,7 +44,7 @@
#include "i18n.h"
#define BLOCK_PROCESS_CALLBACK() Glib::Mutex::Lock em (AudioEngine::instance()->process_lock())
#define BLOCK_PROCESS_CALLBACK() Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock())
using namespace std;
using namespace ARDOUR;
@ -86,7 +86,7 @@ IO::IO (Session& s, const XMLNode& node, DataType dt, bool sendish)
IO::~IO ()
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
BLOCK_PROCESS_CALLBACK ();
@ -104,7 +104,7 @@ IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
we assume that its safely locked by our own ::disconnect().
*/
Glib::Mutex::Lock tm (io_lock, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock tm (io_lock, Glib::Threads::TRY_LOCK);
if (tm.locked()) {
/* we took the lock, so we cannot be here from inside
@ -194,7 +194,7 @@ IO::disconnect (boost::shared_ptr<Port> our_port, string other_port, void* src)
}
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
/* check that our_port is really one of ours */
@ -227,7 +227,7 @@ IO::connect (boost::shared_ptr<Port> our_port, string other_port, void* src)
}
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
/* check that our_port is really one of ours */
@ -264,7 +264,7 @@ IO::remove_port (boost::shared_ptr<Port> port, void* src)
BLOCK_PROCESS_CALLBACK ();
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
if (_ports.remove(port)) {
change.type = IOChange::Type (change.type | IOChange::ConfigurationChanged);
@ -332,7 +332,7 @@ IO::add_port (string destination, void* src, DataType type)
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
/* Create a new port */
@ -377,7 +377,7 @@ int
IO::disconnect (void* src)
{
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
i->disconnect_all ();
@ -479,7 +479,7 @@ IO::ensure_ports (ChanCount count, bool clear, void* src)
change.before = _ports.count ();
{
Glib::Mutex::Lock im (io_lock);
Glib::Threads::Mutex::Lock im (io_lock);
if (ensure_ports_locked (count, clear, changed)) {
return -1;
}
@ -521,7 +521,7 @@ IO::state (bool /*full_state*/)
vector<string>::iterator ci;
int n;
LocaleGuard lg (X_("POSIX"));
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
node->add_property("name", _name);
id().print (buf, sizeof (buf));
@ -883,7 +883,7 @@ IO::create_ports (const XMLNode& node, int version)
get_port_counts (node, version, n, c);
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (ensure_ports (n, true, this)) {
error << string_compose(_("%1: cannot create I/O ports"), _name) << endmsg;
@ -1099,7 +1099,7 @@ IO::set_ports (const string& str)
}
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
// FIXME: audio-only
if (ensure_ports (ChanCount(DataType::AUDIO, nports), true, this)) {
@ -1246,7 +1246,7 @@ IO::connect_ports_to_bundle (boost::shared_ptr<Bundle> c, void* src)
BLOCK_PROCESS_CALLBACK ();
{
Glib::Mutex::Lock lm2 (io_lock);
Glib::Threads::Mutex::Lock lm2 (io_lock);
c->connect (_bundle, _session.engine());
@ -1278,7 +1278,7 @@ IO::disconnect_ports_from_bundle (boost::shared_ptr<Bundle> c, void* src)
BLOCK_PROCESS_CALLBACK ();
{
Glib::Mutex::Lock lm2 (io_lock);
Glib::Threads::Mutex::Lock lm2 (io_lock);
c->disconnect (_bundle, _session.engine());
@ -1314,7 +1314,7 @@ IO::disable_connecting ()
int
IO::enable_connecting ()
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock());
connecting_legal = true;
boost::optional<int> r = ConnectingLegal ();
return r.get_value_or (0);
@ -1720,6 +1720,6 @@ IO::physically_connected () const
bool
IO::has_port (boost::shared_ptr<Port> p) const
{
Glib::Mutex::Lock lm (io_lock);
Glib::Threads::Mutex::Lock lm (io_lock);
return _ports.contains (p);
}

View File

@ -573,7 +573,7 @@ Locations::set_current (Location *loc, bool want_lock)
int ret;
if (want_lock) {
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
ret = set_current_unlocked (loc);
} else {
ret = set_current_unlocked (loc);
@ -635,7 +635,7 @@ void
Locations::clear ()
{
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
@ -660,7 +660,7 @@ void
Locations::clear_markers ()
{
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
LocationList::iterator tmp;
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
@ -682,7 +682,7 @@ void
Locations::clear_ranges ()
{
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
LocationList::iterator tmp;
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
@ -711,7 +711,7 @@ Locations::add (Location *loc, bool make_current)
assert (loc);
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
locations.push_back (loc);
if (make_current) {
@ -743,7 +743,7 @@ Locations::remove (Location *loc)
}
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (i = locations.begin(); i != locations.end(); ++i) {
if ((*i) == loc) {
@ -781,7 +781,7 @@ Locations::get_state ()
{
XMLNode *node = new XMLNode ("Locations");
LocationList::iterator iter;
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (iter = locations.begin(); iter != locations.end(); ++iter) {
node->add_child_nocopy ((*iter)->get_state ());
@ -812,7 +812,7 @@ Locations::set_state (const XMLNode& node, int version)
}
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
XMLNodeConstIterator niter;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
@ -910,7 +910,7 @@ Locations::first_location_before (framepos_t frame, bool include_special_ranges)
LocationList locs;
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
locs = locations;
}
@ -937,7 +937,7 @@ Locations::first_location_after (framepos_t frame, bool include_special_ranges)
LocationList locs;
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
locs = locations;
}
@ -973,7 +973,7 @@ Locations::marks_either_side (framepos_t const frame, framepos_t& before, framep
LocationList locs;
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
locs = locations;
}
@ -1067,7 +1067,7 @@ uint32_t
Locations::num_range_markers () const
{
uint32_t cnt = 0;
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
if ((*i)->is_range_marker()) {
++cnt;
@ -1090,7 +1090,7 @@ Locations::get_location_by_id(PBD::ID id)
void
Locations::find_all_between (framepos_t start, framepos_t end, LocationList& ll, Location::Flags flags)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
if ((flags == 0 || (*i)->matches (flags)) &&

View File

@ -31,7 +31,7 @@
#include "pbd/error.h"
#include "pbd/basename.h"
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/xml++.h"
#include "pbd/memento_command.h"
#include "pbd/enumwriter.h"
@ -131,7 +131,7 @@ MidiDiskstream::init ()
MidiDiskstream::~MidiDiskstream ()
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
}
@ -149,7 +149,7 @@ void
MidiDiskstream::non_realtime_input_change ()
{
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
if (input_change_pending.type == IOChange::NoChange) {
return;
@ -326,7 +326,7 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecnt
return 1;
}
Glib::Mutex::Lock sm (state_lock, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock sm (state_lock, Glib::Threads::TRY_LOCK);
if (!sm.locked()) {
return 1;
@ -376,7 +376,7 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecnt
}
if (buf.size() != 0) {
Glib::Mutex::Lock lm (_gui_feed_buffer_mutex, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex, Glib::Threads::TRY_LOCK);
if (lm.locked ()) {
/* Copy this data into our GUI feed buffer and tell the GUI
@ -503,7 +503,7 @@ MidiDiskstream::overwrite_existing_buffers ()
int
MidiDiskstream::seek (framepos_t frame, bool complete_refill)
{
Glib::Mutex::Lock lm (state_lock);
Glib::Threads::Mutex::Lock lm (state_lock);
int ret = -1;
if (g_atomic_int_get (&_frames_read_from_ringbuffer) == 0) {
@ -789,7 +789,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen
}
/* XXX is there anything we can do if err != 0 ? */
Glib::Mutex::Lock lm (capture_info_lock);
Glib::Threads::Mutex::Lock lm (capture_info_lock);
if (capture_info.empty()) {
goto no_capture_stuff_to_do;
@ -1330,7 +1330,7 @@ MidiDiskstream::get_gui_feed_buffer () const
{
boost::shared_ptr<MidiBuffer> b (new MidiBuffer (AudioEngine::instance()->raw_buffer_size (DataType::MIDI)));
Glib::Mutex::Lock lm (_gui_feed_buffer_mutex);
Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex);
b->copy (_gui_feed_buffer);
return b;
}

View File

@ -1555,7 +1555,7 @@ MidiModel::edit_lock()
boost::shared_ptr<MidiSource> ms = _midi_source.lock ();
assert (ms);
Glib::Mutex::Lock* source_lock = new Glib::Mutex::Lock (ms->mutex());
Glib::Threads::Mutex::Lock* source_lock = new Glib::Threads::Mutex::Lock (ms->mutex());
ms->invalidate(); // Release cached iterator's read lock on model
return WriteLock(new WriteLockImpl(source_lock, _lock, _control_lock));
}
@ -1807,7 +1807,7 @@ MidiModel::set_midi_source (boost::shared_ptr<MidiSource> s)
void
MidiModel::source_interpolation_changed (Evoral::Parameter p, Evoral::ControlList::InterpolationStyle s)
{
Glib::Mutex::Lock lm (_control_lock);
Glib::Threads::Mutex::Lock lm (_control_lock);
control(p)->list()->set_interpolation (s);
}
@ -1826,7 +1826,7 @@ MidiModel::control_list_interpolation_changed (Evoral::Parameter p, Evoral::Cont
void
MidiModel::source_automation_state_changed (Evoral::Parameter p, AutoState s)
{
Glib::Mutex::Lock lm (_control_lock);
Glib::Threads::Mutex::Lock lm (_control_lock);
boost::shared_ptr<AutomationList> al = boost::dynamic_pointer_cast<AutomationList> (control(p)->list ());
al->set_automation_state (s);
}

View File

@ -24,7 +24,7 @@
#include <set>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/xml++.h"
#include "pbd/basename.h"
@ -407,7 +407,7 @@ MidiRegion::model_automation_state_changed (Evoral::Parameter const & p)
for a given set of filtered_parameters, so now that we've changed that list we must invalidate
the iterator.
*/
Glib::Mutex::Lock lm (midi_source(0)->mutex());
Glib::Threads::Mutex::Lock lm (midi_source(0)->mutex());
midi_source(0)->invalidate ();
}

View File

@ -195,7 +195,7 @@ MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_sta
MidiStateTracker* tracker,
std::set<Evoral::Parameter> const & filtered) const
{
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
BeatsFramesConverter converter(_session.tempo_map(), source_start);
@ -260,7 +260,7 @@ MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_sta
framecnt_t
MidiSource::midi_write (MidiRingBuffer<framepos_t>& source, framepos_t source_start, framecnt_t duration)
{
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
const framecnt_t ret = write_unlocked (source, source_start, duration);

View File

@ -85,7 +85,7 @@ MidiStretch::run (boost::shared_ptr<Region> r, Progress*)
boost::shared_ptr<MidiSource> new_src = boost::dynamic_pointer_cast<MidiSource>(nsrcs[0]);
assert(new_src);
Glib::Mutex::Lock sl (new_src->mutex ());
Glib::Threads::Mutex::Lock sl (new_src->mutex ());
new_src->load_model(false, true);
boost::shared_ptr<MidiModel> new_model = new_src->model();

View File

@ -276,7 +276,7 @@ MidiTrack::set_state_part_two ()
int
MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
@ -401,7 +401,7 @@ MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr
void
MidiTrack::realtime_locate ()
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked ()) {
return;
@ -417,7 +417,7 @@ MidiTrack::realtime_locate ()
void
MidiTrack::realtime_handle_transport_stopped ()
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked ()) {
return;

View File

@ -482,7 +482,7 @@ MTC_Slave::resolution () const
void
MTC_Slave::queue_reset (bool reset_pos)
{
Glib::Mutex::Lock lm (reset_lock);
Glib::Threads::Mutex::Lock lm (reset_lock);
reset_pending++;
if (reset_pos) {
reset_position = true;
@ -492,7 +492,7 @@ MTC_Slave::queue_reset (bool reset_pos)
void
MTC_Slave::maybe_reset ()
{
Glib::Mutex::Lock lm (reset_lock);
Glib::Threads::Mutex::Lock lm (reset_lock);
if (reset_pending) {
reset (reset_position);

View File

@ -552,7 +552,7 @@ PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes)
framepos_t end = now + nframes;
framecnt_t offset = 0;
Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock lm (control_lock(), Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
connect_and_run (bufs, nframes, offset, false);

View File

@ -29,20 +29,17 @@ using namespace ARDOUR;
using namespace Glib;
using namespace std;
Private<ThreadBuffers>* ProcessThread::_private_thread_buffers = 0;
static void
release_thread_buffer (void* arg)
{
BufferManager::put_thread_buffers ((ThreadBuffers*) arg);
}
Glib::Threads::Private<ThreadBuffers> ProcessThread::_private_thread_buffers (release_thread_buffer);
void
ProcessThread::init ()
{
if (_private_thread_buffers == 0) {
_private_thread_buffers = new Private<ThreadBuffers> (release_thread_buffer);
}
}
ProcessThread::ProcessThread ()
@ -59,22 +56,22 @@ ProcessThread::get_buffers ()
ThreadBuffers* tb = BufferManager::get_thread_buffers ();
assert (tb);
_private_thread_buffers->set (tb);
_private_thread_buffers.set (tb);
}
void
ProcessThread::drop_buffers ()
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
BufferManager::put_thread_buffers (tb);
_private_thread_buffers->set (0);
_private_thread_buffers.set (0);
}
BufferSet&
ProcessThread::get_silent_buffers (ChanCount count)
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
BufferSet* sb = tb->silent_buffers;
@ -95,7 +92,7 @@ ProcessThread::get_silent_buffers (ChanCount count)
BufferSet&
ProcessThread::get_scratch_buffers (ChanCount count)
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
BufferSet* sb = tb->scratch_buffers;
@ -114,7 +111,7 @@ ProcessThread::get_scratch_buffers (ChanCount count)
BufferSet&
ProcessThread::get_mix_buffers (ChanCount count)
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
BufferSet* mb = tb->mix_buffers;
@ -128,7 +125,7 @@ ProcessThread::get_mix_buffers (ChanCount count)
gain_t*
ProcessThread::gain_automation_buffer()
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
gain_t *g = tb->gain_automation_buffer;
@ -139,7 +136,7 @@ ProcessThread::gain_automation_buffer()
gain_t*
ProcessThread::send_gain_automation_buffer()
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
gain_t* g = tb->send_gain_automation_buffer;
@ -150,7 +147,7 @@ ProcessThread::send_gain_automation_buffer()
pan_t**
ProcessThread::pan_automation_buffer()
{
ThreadBuffers* tb = _private_thread_buffers->get();
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
pan_t** p = tb->pan_automation_buffer;

View File

@ -23,7 +23,7 @@
#include <algorithm>
#include <sstream>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/xml++.h"
#include "ardour/debug.h"

View File

@ -36,10 +36,10 @@ using namespace PBD;
using namespace std;
PBD::Signal1<void,boost::shared_ptr<Region> > RegionFactory::CheckNewRegion;
Glib::StaticMutex RegionFactory::region_map_lock;
Glib::Threads::Mutex RegionFactory::region_map_lock;
RegionFactory::RegionMap RegionFactory::region_map;
PBD::ScopedConnectionList* RegionFactory::region_list_connections = 0;
Glib::StaticMutex RegionFactory::region_name_maps_mutex;
Glib::Threads::Mutex RegionFactory::region_name_maps_mutex;
std::map<std::string, uint32_t> RegionFactory::region_name_number_map;
std::map<std::string, PBD::ID> RegionFactory::region_name_map;
RegionFactory::CompoundAssociations RegionFactory::_compound_associations;
@ -310,7 +310,7 @@ RegionFactory::map_add (boost::shared_ptr<Region> r)
p.second = r;
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
region_map.insert (p);
}
@ -332,7 +332,7 @@ RegionFactory::map_remove (boost::weak_ptr<Region> w)
return;
}
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
RegionMap::iterator i = region_map.find (r->id());
if (i != region_map.end()) {
@ -383,7 +383,7 @@ RegionFactory::clear_map ()
}
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
region_map.clear ();
_compound_associations.clear ();
region_name_map.clear ();
@ -397,7 +397,7 @@ RegionFactory::delete_all_regions ()
/* copy region list */
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
copy = region_map;
}
@ -417,7 +417,7 @@ RegionFactory::delete_all_regions ()
uint32_t
RegionFactory::nregions ()
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
return region_map.size ();
}
@ -427,7 +427,7 @@ RegionFactory::add_to_region_name_maps (boost::shared_ptr<Region> region)
{
update_region_name_number_map (region);
Glib::Mutex::Lock lm (region_name_maps_mutex);
Glib::Threads::Mutex::Lock lm (region_name_maps_mutex);
region_name_map[region->name()] = region->id ();
}
@ -437,7 +437,7 @@ RegionFactory::rename_in_region_name_maps (boost::shared_ptr<Region> region)
{
update_region_name_number_map (region);
Glib::Mutex::Lock lm (region_name_maps_mutex);
Glib::Threads::Mutex::Lock lm (region_name_maps_mutex);
map<string, PBD::ID>::iterator i = region_name_map.begin();
while (i != region_name_map.end() && i->second != region->id ()) {
@ -476,7 +476,7 @@ RegionFactory::update_region_name_number_map (boost::shared_ptr<Region> region)
which is just fine
*/
Glib::Mutex::Lock lm (region_name_maps_mutex);
Glib::Threads::Mutex::Lock lm (region_name_maps_mutex);
region_name_number_map[base] = atoi (number.c_str ());
}
}
@ -526,7 +526,7 @@ RegionFactory::region_name (string& result, string base, bool newlevel)
}
{
Glib::Mutex::Lock lm (region_name_maps_mutex);
Glib::Threads::Mutex::Lock lm (region_name_maps_mutex);
map<string,uint32_t>::iterator x;
@ -622,7 +622,7 @@ RegionFactory::new_region_name (string old)
void
RegionFactory::get_regions_using_source (boost::shared_ptr<Source> s, std::set<boost::shared_ptr<Region> >& r)
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
for (RegionMap::iterator i = region_map.begin(); i != region_map.end(); ++i) {
if (i->second->uses_source (s)) {
@ -634,7 +634,7 @@ RegionFactory::get_regions_using_source (boost::shared_ptr<Source> s, std::set<b
void
RegionFactory::remove_regions_using_source (boost::shared_ptr<Source> src)
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
RegionMap::iterator i = region_map.begin();
while (i != region_map.end()) {
@ -654,6 +654,6 @@ RegionFactory::remove_regions_using_source (boost::shared_ptr<Source> src)
void
RegionFactory::add_compound_association (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> copy)
{
Glib::Mutex::Lock lm (region_map_lock);
Glib::Threads::Mutex::Lock lm (region_map_lock);
_compound_associations[copy] = orig;
}

View File

@ -151,7 +151,7 @@ Return::configure_io (ChanCount in, ChanCount out)
// Ensure there are enough buffers (since we add some)
if (_session.get_scratch_buffers(in).count() < out) {
Glib::Mutex::Lock em (_session.engine().process_lock());
Glib::Threads::Mutex::Lock em (_session.engine().process_lock());
IO::PortCountChanged(out);
}

View File

@ -168,7 +168,7 @@ Route::init ()
{
/* run a configure so that the invisible processors get set up */
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
configure_processors (0);
}
@ -188,7 +188,7 @@ Route::~Route ()
be half-destroyed by now
*/
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->drop_references ();
}
@ -885,7 +885,7 @@ dump_processors(const string& name, const list<boost::shared_ptr<Processor> >& p
boost::shared_ptr<Processor>
Route::before_processor_for_placement (Placement p)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator loc;
@ -910,7 +910,7 @@ Route::before_processor_for_index (int index)
return boost::shared_ptr<Processor> ();
}
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator i = _processors.begin ();
int j = 0;
@ -963,7 +963,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, boost::shared_ptr<
}
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorState pstate (this);
boost::shared_ptr<PluginInsert> pi;
@ -1003,7 +1003,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, boost::shared_ptr<
// configure redirect ports properly, etc.
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors_unlocked (err)) {
pstate.restore ();
@ -1132,7 +1132,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
}
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorState pstate (this);
for (ProcessorList::const_iterator i = others.begin(); i != others.end(); ++i) {
@ -1154,7 +1154,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
}
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors_unlocked (err)) {
pstate.restore ();
configure_processors_unlocked (0); // it worked before we tried to add it ...
@ -1205,7 +1205,7 @@ Route::placement_range(Placement p, ProcessorList::iterator& start, ProcessorLis
void
Route::disable_processors (Placement p)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator start, end;
placement_range(p, start, end);
@ -1222,7 +1222,7 @@ Route::disable_processors (Placement p)
void
Route::disable_processors ()
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->deactivate ();
@ -1237,7 +1237,7 @@ Route::disable_processors ()
void
Route::disable_plugins (Placement p)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator start, end;
placement_range(p, start, end);
@ -1256,7 +1256,7 @@ Route::disable_plugins (Placement p)
void
Route::disable_plugins ()
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<PluginInsert> (*i)) {
@ -1271,7 +1271,7 @@ Route::disable_plugins ()
void
Route::ab_plugins (bool forward)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
if (forward) {
@ -1330,7 +1330,7 @@ Route::clear_processors (Placement p)
}
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorList new_list;
ProcessorStreams err;
bool seen_amp = false;
@ -1376,7 +1376,7 @@ Route::clear_processors (Placement p)
_processors = new_list;
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
configure_processors_unlocked (&err); // this can't fail
}
}
@ -1414,7 +1414,7 @@ Route::remove_processor (boost::shared_ptr<Processor> processor, ProcessorStream
processor_max_streams.reset();
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorState pstate (this);
ProcessorList::iterator i;
@ -1455,7 +1455,7 @@ Route::remove_processor (boost::shared_ptr<Processor> processor, ProcessorStream
}
if (need_process_lock) {
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors_unlocked (err)) {
pstate.restore ();
@ -1506,7 +1506,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
processor_max_streams.reset();
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorState pstate (this);
ProcessorList::iterator i;
@ -1553,7 +1553,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
_output->set_user_latency (0);
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors_unlocked (err)) {
pstate.restore ();
@ -1604,7 +1604,7 @@ Route::configure_processors (ProcessorStreams* err)
assert (!AudioEngine::instance()->process_lock().trylock());
if (!_in_configure_processors) {
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
return configure_processors_unlocked (err);
}
@ -1620,7 +1620,7 @@ Route::input_streams () const
list<pair<ChanCount, ChanCount> >
Route::try_configure_processors (ChanCount in, ProcessorStreams* err)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
return try_configure_processors_unlocked (in, err);
}
@ -1725,7 +1725,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
void
Route::all_visible_processors_active (bool state)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
if (_processors.empty()) {
return;
@ -1756,7 +1756,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
*/
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorState pstate (this);
ProcessorList::iterator oiter;
@ -1818,7 +1818,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
maybe_note_meter_position ();
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors_unlocked (err)) {
pstate.restore ();
@ -2125,7 +2125,7 @@ Route::set_state (const XMLNode& node, int version)
if ((prop = node.property (X_("processor-after-last-custom-meter"))) != 0) {
PBD::ID id (prop->value ());
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::const_iterator i = _processors.begin ();
while (i != _processors.end() && (*i)->id() != id) {
++i;
@ -2559,11 +2559,11 @@ Route::set_processor_state (const XMLNode& node)
}
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
_processors = new_order;
if (must_configure) {
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
configure_processors_unlocked (0);
}
@ -2597,7 +2597,7 @@ Route::curve_reallocate ()
void
Route::silence (framecnt_t nframes)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return;
}
@ -2643,7 +2643,7 @@ Route::add_internal_return ()
void
Route::add_send_to_internal_return (InternalSend* send)
{
Glib::RWLock::ReaderLock rm (_processor_lock);
Glib::Threads::RWLock::ReaderLock rm (_processor_lock);
for (ProcessorList::const_iterator x = _processors.begin(); x != _processors.end(); ++x) {
boost::shared_ptr<InternalReturn> d = boost::dynamic_pointer_cast<InternalReturn>(*x);
@ -2657,7 +2657,7 @@ Route::add_send_to_internal_return (InternalSend* send)
void
Route::remove_send_from_internal_return (InternalSend* send)
{
Glib::RWLock::ReaderLock rm (_processor_lock);
Glib::Threads::RWLock::ReaderLock rm (_processor_lock);
for (ProcessorList::const_iterator x = _processors.begin(); x != _processors.end(); ++x) {
boost::shared_ptr<InternalReturn> d = boost::dynamic_pointer_cast<InternalReturn>(*x);
@ -2697,7 +2697,7 @@ Route::add_aux_send (boost::shared_ptr<Route> route, boost::shared_ptr<Processor
assert (route != _session.monitor_out ());
{
Glib::RWLock::ReaderLock rm (_processor_lock);
Glib::Threads::RWLock::ReaderLock rm (_processor_lock);
for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ++x) {
@ -2715,7 +2715,7 @@ Route::add_aux_send (boost::shared_ptr<Route> route, boost::shared_ptr<Processor
boost::shared_ptr<InternalSend> listener;
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
listener.reset (new InternalSend (_session, _pannable, _mute_master, route, Delivery::Aux));
}
@ -2735,7 +2735,7 @@ Route::remove_aux_or_listen (boost::shared_ptr<Route> route)
ProcessorList::iterator tmp;
{
Glib::RWLock::ReaderLock rl(_processor_lock);
Glib::Threads::RWLock::ReaderLock rl(_processor_lock);
/* have to do this early because otherwise processor reconfig
* will put _monitor_send back in the list
@ -2871,7 +2871,7 @@ Route::nonrealtime_handle_transport_stopped (bool /*abort_ignored*/, bool did_lo
framepos_t now = _session.transport_frame();
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
Automatable::transport_stopped (now);
@ -2958,7 +2958,7 @@ Route::pans_required () const
int
Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
@ -2995,7 +2995,7 @@ Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int
Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& /* need_butler */)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
@ -3036,7 +3036,7 @@ Route::flush_processors ()
this is called from the RT audio thread.
*/
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->flush ();
@ -3055,7 +3055,7 @@ Route::set_meter_point (MeterPoint p, bool force)
bool meter_was_visible_to_user = _meter->display_to_user ();
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
maybe_note_meter_position ();
@ -3122,11 +3122,11 @@ void
Route::listen_position_changed ()
{
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
ProcessorState pstate (this);
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (configure_processors_unlocked (0)) {
pstate.restore ();
@ -3149,7 +3149,7 @@ Route::add_export_point()
_capturing_processor->activate ();
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
configure_processors (0);
}
@ -3363,7 +3363,7 @@ Route::shift (framepos_t pos, framecnt_t frames)
/* redirect automation */
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin (); i != _processors.end (); ++i) {
set<Evoral::Parameter> parameters = (*i)->what_can_be_automated();
@ -3463,7 +3463,7 @@ Route::set_name_in_state (XMLNode& node, string const & name)
boost::shared_ptr<Send>
Route::internal_send_for (boost::shared_ptr<const Route> target) const
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<InternalSend> send;
@ -3547,7 +3547,7 @@ Route::set_active (bool yn, void* src)
void
Route::meter ()
{
Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock rm (_processor_lock, Glib::Threads::TRY_LOCK);
assert (_meter);
@ -3602,7 +3602,7 @@ Route::get_control (const Evoral::Parameter& param)
/* maybe one of our processors does or ... */
Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock rm (_processor_lock, Glib::Threads::TRY_LOCK);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((c = boost::dynamic_pointer_cast<AutomationControl>((*i)->control (param))) != 0) {
break;
@ -3624,7 +3624,7 @@ Route::get_control (const Evoral::Parameter& param)
boost::shared_ptr<Processor>
Route::nth_plugin (uint32_t n)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator i;
for (i = _processors.begin(); i != _processors.end(); ++i) {
@ -3641,7 +3641,7 @@ Route::nth_plugin (uint32_t n)
boost::shared_ptr<Processor>
Route::nth_send (uint32_t n)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator i;
for (i = _processors.begin(); i != _processors.end(); ++i) {
@ -3658,7 +3658,7 @@ Route::nth_send (uint32_t n)
bool
Route::has_io_processor_named (const string& name)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator i;
for (i = _processors.begin(); i != _processors.end(); ++i) {
@ -3682,7 +3682,7 @@ Route::mute_points () const
void
Route::set_processor_positions ()
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
bool had_amp = false;
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
@ -3714,7 +3714,7 @@ Route::unknown_processors () const
{
list<string> p;
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<UnknownProcessor const> (*i)) {
p.push_back ((*i)->name ());
@ -3839,7 +3839,7 @@ void
Route::setup_invisible_processors ()
{
#ifndef NDEBUG
Glib::RWLock::WriterLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::WriterLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
assert (!lm.locked ());
#endif
@ -3995,8 +3995,8 @@ Route::setup_invisible_processors ()
void
Route::unpan ()
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::RWLock::ReaderLock lp (_processor_lock);
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::RWLock::ReaderLock lp (_processor_lock);
_pannable.reset ();
@ -4040,7 +4040,7 @@ Route::maybe_note_meter_position ()
boost::shared_ptr<Processor>
Route::processor_by_id (PBD::ID id) const
{
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((*i)->id() == id) {
return *i;
@ -4088,7 +4088,7 @@ Route::has_external_redirects () const
boost::shared_ptr<Processor>
Route::the_instrument () const
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<PluginInsert>(*i)) {
if ((*i)->input_streams().n_midi() > 0 &&
@ -4108,7 +4108,7 @@ Route::non_realtime_locate (framepos_t pos)
}
{
Glib::RWLock::WriterLock lm (_processor_lock);
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->transport_located (pos);

View File

@ -30,7 +30,7 @@
#include <unistd.h>
#include <limits.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
@ -560,7 +560,7 @@ Session::when_engine_running ()
ControlProtocolManager::instance().midi_connectivity_established ();
if (_is_new && !no_auto_connect()) {
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock());
auto_connect_master_bus ();
}
@ -626,7 +626,7 @@ Session::remove_monitor_section ()
* pieces of audio as we work on each route.
*/
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
/* Connect tracks to monitor section. Note that in an
existing session, the internal sends will already exist, but we want the
@ -672,7 +672,7 @@ Session::add_monitor_section ()
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
r->input()->ensure_io (_master_out->output()->n_ports(), false, this);
r->output()->ensure_io (_master_out->output()->n_ports(), false, this);
}
@ -773,7 +773,7 @@ Session::add_monitor_section ()
* pieces of audio as we work on each route.
*/
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
/* Connect tracks to monitor section. Note that in an
existing session, the internal sends will already exist, but we want the
@ -1625,7 +1625,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost:
// boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
#endif
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (track->input()->ensure_io (input, false, this)) {
error << "cannot configure " << input << " out configuration for new midi track" << endmsg;
goto failed;
@ -1725,7 +1725,7 @@ Session::auto_connect_route (boost::shared_ptr<Route> route, ChanCount& existing
return;
}
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock (), Glib::NOT_LOCK);
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock (), Glib::Threads::NOT_LOCK);
if (with_lock) {
lm.acquire ();
@ -1860,7 +1860,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
// boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
#endif
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (track->input()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) {
error << string_compose (
@ -1946,7 +1946,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
// boost_debug_shared_ptr_mark_interesting (bus.get(), "Route");
#endif
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (bus->input()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) {
error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
@ -2062,7 +2062,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
loading this normally happens in a different way.
*/
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
IOChange change (IOChange::Type (IOChange::ConfigurationChanged | IOChange::ConnectionsChanged));
change.after = route->input()->n_ports();
@ -2183,7 +2183,7 @@ Session::add_routes (RouteList& new_routes, bool input_auto_connect, bool output
if (_monitor_out && IO::connecting_legal) {
{
Glib::Mutex::Lock lm (_engine.process_lock());
Glib::Threads::Mutex::Lock lm (_engine.process_lock());
for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
if ((*x)->is_monitor()) {
@ -2854,7 +2854,7 @@ Session::find_whole_file_parent (boost::shared_ptr<Region const> child) const
RegionFactory::RegionMap::const_iterator i;
boost::shared_ptr<Region> region;
Glib::Mutex::Lock lm (region_lock);
Glib::Threads::Mutex::Lock lm (region_lock);
for (i = regions.begin(); i != regions.end(); ++i) {
@ -2900,7 +2900,7 @@ Session::destroy_sources (list<boost::shared_ptr<Source> > srcs)
for (list<boost::shared_ptr<Source> >::iterator s = srcs.begin(); s != srcs.end(); ) {
{
Glib::Mutex::Lock ls (source_lock);
Glib::Threads::Mutex::Lock ls (source_lock);
/* remove from the main source list */
sources.erase ((*s)->id());
}
@ -2953,7 +2953,7 @@ Session::add_source (boost::shared_ptr<Source> source)
entry.second = source;
{
Glib::Mutex::Lock lm (source_lock);
Glib::Threads::Mutex::Lock lm (source_lock);
result = sources.insert (entry);
}
@ -2998,7 +2998,7 @@ Session::remove_source (boost::weak_ptr<Source> src)
}
{
Glib::Mutex::Lock lm (source_lock);
Glib::Threads::Mutex::Lock lm (source_lock);
if ((i = sources.find (source->id())) != sources.end()) {
sources.erase (i);
@ -3018,7 +3018,7 @@ Session::remove_source (boost::weak_ptr<Source> src)
boost::shared_ptr<Source>
Session::source_by_id (const PBD::ID& id)
{
Glib::Mutex::Lock lm (source_lock);
Glib::Threads::Mutex::Lock lm (source_lock);
SourceMap::iterator i;
boost::shared_ptr<Source> source;
@ -3032,7 +3032,7 @@ Session::source_by_id (const PBD::ID& id)
boost::shared_ptr<Source>
Session::source_by_path_and_channel (const string& path, uint16_t chn)
{
Glib::Mutex::Lock lm (source_lock);
Glib::Threads::Mutex::Lock lm (source_lock);
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
boost::shared_ptr<AudioFileSource> afs
@ -3049,7 +3049,7 @@ uint32_t
Session::count_sources_by_origin (const string& path)
{
uint32_t cnt = 0;
Glib::Mutex::Lock lm (source_lock);
Glib::Threads::Mutex::Lock lm (source_lock);
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
boost::shared_ptr<FileSource> fs
@ -3514,7 +3514,7 @@ Session::graph_reordered ()
boost::optional<framecnt_t>
Session::available_capture_duration ()
{
Glib::Mutex::Lock lm (space_lock);
Glib::Threads::Mutex::Lock lm (space_lock);
if (_total_free_4k_blocks_uncertain) {
return boost::optional<framecnt_t> ();
@ -4562,7 +4562,7 @@ void
Session::initialize_latencies ()
{
{
Glib::Mutex::Lock lm (_engine.process_lock());
Glib::Threads::Mutex::Lock lm (_engine.process_lock());
update_latency (false);
update_latency (true);
}

View File

@ -25,7 +25,7 @@
#include <fcntl.h>
#include <poll.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/error.h"
#include "pbd/pthread_utils.h"

View File

@ -51,7 +51,7 @@ Session::click (framepos_t start, framecnt_t nframes)
return;
}
Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::WriterLock clickm (click_lock, Glib::Threads::TRY_LOCK);
/* how far have we moved since the last time the clicks got cleared
*/
@ -225,7 +225,7 @@ Session::setup_click_sounds (int which)
void
Session::clear_clicks ()
{
Glib::RWLock::WriterLock lm (click_lock);
Glib::Threads::RWLock::WriterLock lm (click_lock);
for (Clicks::iterator i = clicks.begin(); i != clicks.end(); ++i) {
delete *i;

View File

@ -19,7 +19,7 @@
#include "pbd/error.h"
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <midi++/manager.h>
#include <midi++/mmc.h>

View File

@ -69,7 +69,7 @@ SessionPlaylists::~SessionPlaylists ()
bool
SessionPlaylists::add (boost::shared_ptr<Playlist> playlist)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
bool const existing = find (playlists.begin(), playlists.end(), playlist) != playlists.end();
@ -96,7 +96,7 @@ SessionPlaylists::remove_weak (boost::weak_ptr<Playlist> playlist)
void
SessionPlaylists::remove (boost::shared_ptr<Playlist> playlist)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
List::iterator i;
@ -129,7 +129,7 @@ SessionPlaylists::track (bool inuse, boost::weak_ptr<Playlist> wpl)
}
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
if (!inuse) {
@ -154,14 +154,14 @@ SessionPlaylists::track (bool inuse, boost::weak_ptr<Playlist> wpl)
uint32_t
SessionPlaylists::n_playlists () const
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
return playlists.size();
}
boost::shared_ptr<Playlist>
SessionPlaylists::by_name (string name)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {
if ((*i)->name() == name) {
@ -181,7 +181,7 @@ SessionPlaylists::by_name (string name)
boost::shared_ptr<Playlist>
SessionPlaylists::by_id (const PBD::ID& id)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {
if ((*i)->id() == id) {
@ -201,7 +201,7 @@ SessionPlaylists::by_id (const PBD::ID& id)
void
SessionPlaylists::unassigned (std::list<boost::shared_ptr<Playlist> > & list)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {
if (!(*i)->get_orig_track_id().to_s().compare ("0")) {
@ -219,7 +219,7 @@ SessionPlaylists::unassigned (std::list<boost::shared_ptr<Playlist> > & list)
void
SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s) const
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {
s.push_back (*i);
@ -233,7 +233,7 @@ SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s) const
void
SessionPlaylists::destroy_region (boost::shared_ptr<Region> r)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {
(*i)->destroy_region (r);
@ -270,7 +270,7 @@ SessionPlaylists::source_use_count (boost::shared_ptr<const Source> src) const
void
SessionPlaylists::sync_all_regions_with_regions ()
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
for (List::const_iterator p = playlists.begin(); p != playlists.end(); ++p) {
(*p)->sync_all_regions_with_regions ();
@ -411,7 +411,7 @@ SessionPlaylists::XMLPlaylistFactory (Session& session, const XMLNode& node)
boost::shared_ptr<Crossfade>
SessionPlaylists::find_crossfade (const PBD::ID& id)
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
boost::shared_ptr<Crossfade> c;
@ -435,7 +435,7 @@ SessionPlaylists::find_crossfade (const PBD::ID& id)
uint32_t
SessionPlaylists::region_use_count (boost::shared_ptr<Region> region) const
{
Glib::Mutex::Lock lm (lock);
Glib::Threads::Mutex::Lock lm (lock);
uint32_t cnt = 0;
for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {

View File

@ -25,7 +25,7 @@
#include "pbd/error.h"
#include "pbd/enumwriter.h"
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "ardour/audioengine.h"
#include "ardour/auditioner.h"

View File

@ -54,7 +54,7 @@
#include <glib/gstdio.h>
#include <glibmm.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <boost/algorithm/string.hpp>
@ -576,7 +576,7 @@ Session::create (const string& session_template, BusProfile* bus_profile)
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
{
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
r->input()->ensure_io (count, false, this);
r->output()->ensure_io (count, false, this);
}
@ -1043,7 +1043,7 @@ Session::state (bool full_state)
child = node->add_child ("Sources");
if (full_state) {
Glib::Mutex::Lock sl (source_lock);
Glib::Threads::Mutex::Lock sl (source_lock);
for (SourceMap::iterator siter = sources.begin(); siter != sources.end(); ++siter) {
@ -1070,7 +1070,7 @@ Session::state (bool full_state)
child = node->add_child ("Regions");
if (full_state) {
Glib::Mutex::Lock rl (region_lock);
Glib::Threads::Mutex::Lock rl (region_lock);
const RegionFactory::RegionMap& region_map (RegionFactory::all_regions());
for (RegionFactory::RegionMap::const_iterator i = region_map.begin(); i != region_map.end(); ++i) {
boost::shared_ptr<Region> r = i->second;
@ -1879,7 +1879,7 @@ Session::get_sources_as_xml ()
{
XMLNode* node = new XMLNode (X_("Sources"));
Glib::Mutex::Lock lm (source_lock);
Glib::Threads::Mutex::Lock lm (source_lock);
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
node->add_child_nocopy (i->second->get_state());
@ -2066,7 +2066,7 @@ Session::refresh_disk_space ()
{
#if HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H
Glib::Mutex::Lock lm (space_lock);
Glib::Threads::Mutex::Lock lm (space_lock);
/* get freespace on every FS that is part of the session path */
@ -3003,7 +3003,7 @@ Session::add_controllable (boost::shared_ptr<Controllable> c)
as part of the session.
*/
Glib::Mutex::Lock lm (controllables_lock);
Glib::Threads::Mutex::Lock lm (controllables_lock);
controllables.insert (c);
}
@ -3016,7 +3016,7 @@ Session::remove_controllable (Controllable* c)
return;
}
Glib::Mutex::Lock lm (controllables_lock);
Glib::Threads::Mutex::Lock lm (controllables_lock);
Controllables::iterator x = controllables.find (boost::shared_ptr<Controllable>(c, null_deleter()));
@ -3028,7 +3028,7 @@ Session::remove_controllable (Controllable* c)
boost::shared_ptr<Controllable>
Session::controllable_by_id (const PBD::ID& id)
{
Glib::Mutex::Lock lm (controllables_lock);
Glib::Threads::Mutex::Lock lm (controllables_lock);
for (Controllables::iterator i = controllables.begin(); i != controllables.end(); ++i) {
if ((*i)->id() == id) {
@ -3387,7 +3387,7 @@ Session::config_changed (std::string p, bool ours)
} else if (p == "edit-mode") {
Glib::Mutex::Lock lm (playlists->lock);
Glib::Threads::Mutex::Lock lm (playlists->lock);
for (SessionPlaylists::List::iterator i = playlists->playlists.begin(); i != playlists->playlists.end(); ++i) {
(*i)->set_edit_mode (Config->get_edit_mode ());

View File

@ -921,7 +921,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
/* this is functionally what clear_clicks() does but with a tentative lock */
Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::WriterLock clickm (click_lock, Glib::Threads::TRY_LOCK);
if (clickm.locked()) {

View File

@ -427,7 +427,7 @@ SMFSource::mark_streaming_write_completed ()
void
SMFSource::mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption stuck_notes_option, Evoral::MusicalTime when)
{
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
MidiSource::mark_midi_streaming_write_completed (stuck_notes_option, when);
if (!writable()) {
@ -459,9 +459,9 @@ SMFSource::load_model (bool lock, bool force_reload)
return;
}
boost::shared_ptr<Glib::Mutex::Lock> lm;
boost::shared_ptr<Glib::Threads::Mutex::Lock> lm;
if (lock)
lm = boost::shared_ptr<Glib::Mutex::Lock>(new Glib::Mutex::Lock(_lock));
lm = boost::shared_ptr<Glib::Threads::Mutex::Lock>(new Glib::Threads::Mutex::Lock(_lock));
if (_model && !force_reload) {
return;

View File

@ -29,7 +29,7 @@
#include <algorithm>
#include <fstream>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#include "pbd/xml++.h"
@ -162,7 +162,7 @@ Source::set_state (const XMLNode& node, int version)
bool
Source::has_been_analysed() const
{
Glib::Mutex::Lock lm (_analysis_lock);
Glib::Threads::Mutex::Lock lm (_analysis_lock);
return _analysed;
}
@ -170,7 +170,7 @@ void
Source::set_been_analysed (bool yn)
{
{
Glib::Mutex::Lock lm (_analysis_lock);
Glib::Threads::Mutex::Lock lm (_analysis_lock);
_analysed = yn;
}
@ -292,14 +292,14 @@ void
Source::dec_use_count ()
{
#ifndef NDEBUG
gint oldval = g_atomic_int_exchange_and_add (&_use_count, -1);
gint oldval = g_atomic_int_add (&_use_count, -1);
if (oldval <= 0) {
cerr << "Bad use dec for " << name() << endl;
abort ();
}
assert (oldval > 0);
#else
g_atomic_int_exchange_and_add (&_use_count, -1);
g_atomic_int_add (&_use_count, -1);
#endif
}

View File

@ -50,8 +50,8 @@ using namespace std;
using namespace PBD;
PBD::Signal1<void,boost::shared_ptr<Source> > SourceFactory::SourceCreated;
Glib::Cond* SourceFactory::PeaksToBuild;
Glib::StaticMutex SourceFactory::peak_building_lock = GLIBMM_STATIC_MUTEX_INIT;
Glib::Threads::Cond SourceFactory::PeaksToBuild;
Glib::Threads::Mutex SourceFactory::peak_building_lock;
std::list<boost::weak_ptr<AudioSource> > SourceFactory::files_with_peaks;
static void
@ -65,7 +65,7 @@ peak_thread_work ()
wait:
if (SourceFactory::files_with_peaks.empty()) {
SourceFactory::PeaksToBuild->wait (SourceFactory::peak_building_lock);
SourceFactory::PeaksToBuild.wait (SourceFactory::peak_building_lock);
}
if (SourceFactory::files_with_peaks.empty()) {
@ -87,10 +87,8 @@ peak_thread_work ()
void
SourceFactory::init ()
{
PeaksToBuild = new Glib::Cond();
for (int n = 0; n < 2; ++n) {
Glib::Thread::create (sigc::ptr_fun (::peak_thread_work), false);
Glib::Threads::Thread::create (sigc::ptr_fun (::peak_thread_work));
}
}
@ -103,9 +101,9 @@ SourceFactory::setup_peakfile (boost::shared_ptr<Source> s, bool async)
if (async) {
Glib::Mutex::Lock lm (peak_building_lock);
Glib::Threads::Mutex::Lock lm (peak_building_lock);
files_with_peaks.push_back (boost::weak_ptr<AudioSource> (as));
PeaksToBuild->broadcast ();
PeaksToBuild.broadcast ();
} else {

View File

@ -23,7 +23,7 @@
#include <unistd.h>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/xml++.h"
#include "evoral/types.hpp"
#include "ardour/debug.h"
@ -311,7 +311,7 @@ TempoMap::remove_tempo (const TempoSection& tempo, bool complete_operation)
bool removed = false;
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
Metrics::iterator i;
for (i = metrics.begin(); i != metrics.end(); ++i) {
@ -342,7 +342,7 @@ TempoMap::remove_meter (const MeterSection& tempo, bool complete_operation)
bool removed = false;
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
Metrics::iterator i;
for (i = metrics.begin(); i != metrics.end(); ++i) {
@ -488,7 +488,7 @@ TempoMap::replace_tempo (const TempoSection& ts, const Tempo& tempo, const BBT_T
add_tempo (tempo, where);
} else {
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
/* cannot move the first tempo section */
*((Tempo*)&first) = tempo;
recompute_map (false);
@ -502,7 +502,7 @@ void
TempoMap::add_tempo (const Tempo& tempo, BBT_Time where)
{
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
/* new tempos always start on a beat */
where.ticks = 0;
@ -558,7 +558,7 @@ TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const BBT_T
add_meter (meter, where);
} else {
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
/* cannot move the first meter section */
*((Meter*)&first) = meter;
recompute_map (true);
@ -572,7 +572,7 @@ void
TempoMap::add_meter (const Meter& meter, BBT_Time where)
{
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
/* a new meter always starts a new bar on the first beat. so
round the start time appropriately. remember that
@ -612,7 +612,7 @@ TempoMap::change_initial_tempo (double beats_per_minute, double note_type)
for (Metrics::iterator i = metrics.begin(); i != metrics.end(); ++i) {
if ((t = dynamic_cast<TempoSection*> (*i)) != 0) {
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
*((Tempo*) t) = newtempo;
recompute_map (false);
}
@ -662,7 +662,7 @@ TempoMap::change_existing_tempo_at (framepos_t where, double beats_per_minute, d
/* reset */
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
/* cannot move the first tempo section */
*((Tempo*)prev) = newtempo;
recompute_map (false);
@ -706,7 +706,7 @@ TempoMap::first_tempo () const
void
TempoMap::require_map_to (framepos_t pos)
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
if (_map.empty() || _map.back().frame < pos) {
extend_map (pos);
@ -716,7 +716,7 @@ TempoMap::require_map_to (framepos_t pos)
void
TempoMap::require_map_to (const BBT_Time& bbt)
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
/* since we have no idea where BBT is if its off the map, see the last
* point in the map is past BBT, and if not add an arbitrary amount of
@ -1039,7 +1039,7 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
TempoMetric
TempoMap::metric_at (framepos_t frame) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
TempoMetric m (first_meter(), first_tempo());
const Meter* meter;
const Tempo* tempo;
@ -1073,7 +1073,7 @@ TempoMap::metric_at (framepos_t frame) const
TempoMetric
TempoMap::metric_at (BBT_Time bbt) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
TempoMetric m (first_meter(), first_tempo());
const Meter* meter;
const Tempo* tempo;
@ -1111,7 +1111,7 @@ TempoMap::bbt_time (framepos_t frame, BBT_Time& bbt)
{
require_map_to (frame);
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
if (frame < 0) {
bbt.bars = 1;
@ -1127,7 +1127,7 @@ TempoMap::bbt_time (framepos_t frame, BBT_Time& bbt)
void
TempoMap::bbt_time_rt (framepos_t frame, BBT_Time& bbt)
{
Glib::RWLock::ReaderLock lm (lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
throw std::logic_error ("TempoMap::bbt_time_rt() could not lock tempo map");
@ -1170,7 +1170,7 @@ TempoMap::frame_time (const BBT_Time& bbt)
require_map_to (bbt);
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
BBTPointList::const_iterator s = bbt_before_or_at (BBT_Time (1, 1, 0));
BBTPointList::const_iterator e = bbt_before_or_at (BBT_Time (bbt.bars, bbt.beats, 0));
@ -1189,7 +1189,7 @@ TempoMap::bbt_duration_at (framepos_t pos, const BBT_Time& bbt, int dir)
BBT_Time when;
bbt_time (pos, when);
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
return bbt_duration_at_unlocked (when, bbt, dir);
}
@ -1256,7 +1256,7 @@ TempoMap::round_to_beat_subdivision (framepos_t fr, int sub_num, int dir)
{
require_map_to (fr);
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
BBTPointList::const_iterator i = bbt_before_or_at (fr);
BBT_Time the_beat;
uint32_t ticks_one_subdivisions_worth;
@ -1375,7 +1375,7 @@ TempoMap::round_to_type (framepos_t frame, int dir, BBTPointType type)
{
require_map_to (frame);
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
BBTPointList::const_iterator fi;
if (dir > 0) {
@ -1521,7 +1521,7 @@ TempoMap::get_grid (TempoMap::BBTPointList::const_iterator& begin,
framepos_t lower, framepos_t upper)
{
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
if (_map.empty() || (_map.back().frame < upper)) {
recompute_map (false, upper);
}
@ -1534,7 +1534,7 @@ TempoMap::get_grid (TempoMap::BBTPointList::const_iterator& begin,
const TempoSection&
TempoMap::tempo_section_at (framepos_t frame) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
Metrics::const_iterator i;
TempoSection* prev = 0;
@ -1580,7 +1580,7 @@ TempoMap::get_state ()
XMLNode *root = new XMLNode ("TempoMap");
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
for (i = metrics.begin(); i != metrics.end(); ++i) {
root->add_child_nocopy ((*i)->get_state());
}
@ -1593,7 +1593,7 @@ int
TempoMap::set_state (const XMLNode& node, int /*version*/)
{
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
XMLNodeList nlist;
XMLNodeConstIterator niter;
@ -1679,7 +1679,7 @@ TempoMap::set_state (const XMLNode& node, int /*version*/)
void
TempoMap::dump (std::ostream& o) const
{
Glib::RWLock::ReaderLock lm (lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (lock, Glib::Threads::TRY_LOCK);
const MeterSection* m;
const TempoSection* t;
@ -1698,7 +1698,7 @@ TempoMap::dump (std::ostream& o) const
int
TempoMap::n_tempos() const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
int cnt = 0;
for (Metrics::const_iterator i = metrics.begin(); i != metrics.end(); ++i) {
@ -1713,7 +1713,7 @@ TempoMap::n_tempos() const
int
TempoMap::n_meters() const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
int cnt = 0;
for (Metrics::const_iterator i = metrics.begin(); i != metrics.end(); ++i) {
@ -1729,7 +1729,7 @@ void
TempoMap::insert_time (framepos_t where, framecnt_t amount)
{
{
Glib::RWLock::WriterLock lm (lock);
Glib::Threads::RWLock::WriterLock lm (lock);
for (Metrics::iterator i = metrics.begin(); i != metrics.end(); ++i) {
if ((*i)->frame() >= where && (*i)->movable ()) {
(*i)->set_frame ((*i)->frame() + amount);
@ -1825,7 +1825,7 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount)
framepos_t
TempoMap::framepos_plus_beats (framepos_t pos, Evoral::MusicalTime beats) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
Metrics::const_iterator next_tempo;
const TempoSection* tempo = 0;
@ -1914,7 +1914,7 @@ TempoMap::framepos_plus_beats (framepos_t pos, Evoral::MusicalTime beats) const
framepos_t
TempoMap::framepos_minus_beats (framepos_t pos, Evoral::MusicalTime beats) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
Metrics::const_reverse_iterator prev_tempo;
const TempoSection* tempo = 0;
@ -2023,7 +2023,7 @@ TempoMap::framepos_minus_beats (framepos_t pos, Evoral::MusicalTime beats) const
framepos_t
TempoMap::framepos_plus_bbt (framepos_t pos, BBT_Time op) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
Metrics::const_iterator i;
const MeterSection* meter;
const MeterSection* m;
@ -2161,7 +2161,7 @@ TempoMap::framepos_plus_bbt (framepos_t pos, BBT_Time op) const
Evoral::MusicalTime
TempoMap::framewalk_to_beats (framepos_t pos, framecnt_t distance) const
{
Glib::RWLock::ReaderLock lm (lock);
Glib::Threads::RWLock::ReaderLock lm (lock);
Metrics::const_iterator next_tempo;
const TempoSection* tempo = 0;
framepos_t effective_pos = max (pos, (framepos_t) 0);

View File

@ -255,7 +255,7 @@ void
Track::deactivate_visible_processors ()
{
_deactivated_processors.clear ();
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((*i)->active() && (*i)->display_to_user() && boost::dynamic_pointer_cast<Amp> (*i) == 0) {
@ -365,7 +365,7 @@ Track::set_latency_compensation (framecnt_t longest_session_latency)
int
Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
@ -448,7 +448,7 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int
Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/, bool& need_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
@ -908,7 +908,7 @@ Track::check_initial_delay (framecnt_t nframes, framepos_t& transport_frame)
to reflect that we just wrote _roll_delay frames of silence.
*/
Glib::RWLock::ReaderLock lm (_processor_lock);
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i);
if (iop) {

View File

@ -90,7 +90,7 @@ ARDOUR::UserBundle::get_state ()
node->add_property ("name", name ());
{
Glib::Mutex::Lock lm (_channel_mutex);
Glib::Threads::Mutex::Lock lm (_channel_mutex);
for (std::vector<Channel>::iterator i = _channel.begin(); i != _channel.end(); ++i) {
XMLNode* c = new XMLNode ("Channel");

View File

@ -26,7 +26,7 @@ namespace ARDOUR {
Worker::Worker(Workee* workee, uint32_t ring_size)
: _workee(workee)
, _thread(Glib::Thread::create(sigc::mem_fun(*this, &Worker::run), true))
, _thread (Glib::Threads::Thread::create(sigc::mem_fun(*this, &Worker::run)))
, _requests(new RingBuffer<uint8_t>(ring_size))
, _responses(new RingBuffer<uint8_t>(ring_size))
, _response((uint8_t*)malloc(ring_size))

View File

@ -2,6 +2,7 @@
#define AUDIOGRAPHER_THREADER_H
#include <glibmm/threadpool.h>
#include <glibmm/timeval.h>
#include <sigc++/slot.h>
#include <boost/format.hpp>
@ -86,11 +87,8 @@ class Threader : public Source<T>, public Sink<T>
void wait()
{
while (g_atomic_int_get (&readers) != 0) {
Glib::TimeVal wait_time;
wait_time.assign_current_time();
wait_time.add_milliseconds(wait_timeout);
wait_cond.timed_wait(wait_mutex, wait_time);
gint64 end_time = g_get_monotonic_time () + (wait_timeout * G_TIME_SPAN_MILLISECOND);
wait_cond.wait_until(wait_mutex, end_time);
}
wait_mutex.unlock();
@ -119,12 +117,12 @@ class Threader : public Source<T>, public Sink<T>
OutputVec outputs;
Glib::ThreadPool & thread_pool;
Glib::Mutex wait_mutex;
Glib::Cond wait_cond;
Glib::Threads::Mutex wait_mutex;
Glib::Threads::Cond wait_cond;
gint readers;
long wait_timeout;
Glib::Mutex exception_mutex;
Glib::Threads::Mutex exception_mutex;
boost::shared_ptr<ThreaderException> exception;
};

View File

@ -1,8 +1,6 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include <glibmm/thread.h>
int main()
{
Glib::thread_init();

View File

@ -23,7 +23,7 @@
#include <list>
#include <boost/pool/pool.hpp>
#include <boost/pool/pool_alloc.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/signals.h"
#include "evoral/types.hpp"
#include "evoral/Range.hpp"
@ -107,7 +107,7 @@ public:
EventList::size_type size() const { return _events.size(); }
double length() const {
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
return _events.empty() ? 0.0 : _events.back()->when;
}
bool empty() const { return _events.empty(); }
@ -165,18 +165,18 @@ public:
std::pair<ControlList::iterator,ControlList::iterator> control_points_adjacent (double when);
template<class T> void apply_to_points (T& obj, void (T::*method)(const ControlList&)) {
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
(obj.*method)(*this);
}
double eval (double where) {
Glib::Mutex::Lock lm (_lock);
Glib::Threads::Mutex::Lock lm (_lock);
return unlocked_eval (where);
}
double rt_safe_eval (double where, bool& ok) {
Glib::Mutex::Lock lm (_lock, Glib::TRY_LOCK);
Glib::Threads::Mutex::Lock lm (_lock, Glib::Threads::TRY_LOCK);
if ((ok = lm.locked())) {
return unlocked_eval (where);
@ -207,7 +207,7 @@ public:
double default_value() const { return _parameter.normal(); }
// FIXME: const violations for Curve
Glib::Mutex& lock() const { return _lock; }
Glib::Threads::Mutex& lock() const { return _lock; }
LookupCache& lookup_cache() const { return _lookup_cache; }
SearchCache& search_cache() const { return _search_cache; }
@ -280,7 +280,7 @@ protected:
Parameter _parameter;
InterpolationStyle _interpolation;
EventList _events;
mutable Glib::Mutex _lock;
mutable Glib::Threads::Mutex _lock;
int8_t _frozen;
bool _changed_when_thawed;
double _min_yval;

View File

@ -23,7 +23,7 @@
#include <map>
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <glibmm/thread.h>
#include <glibmm/threads.h>
#include "pbd/signals.h"
#include "evoral/types.hpp"
#include "evoral/Parameter.hpp"
@ -65,13 +65,13 @@ public:
void what_has_data(std::set<Parameter>&) const;
Glib::Mutex& control_lock() const { return _control_lock; }
Glib::Threads::Mutex& control_lock() const { return _control_lock; }
protected:
virtual void control_list_marked_dirty () {}
virtual void control_list_interpolation_changed (Parameter, ControlList::InterpolationStyle) {}
mutable Glib::Mutex _control_lock;
mutable Glib::Threads::Mutex _control_lock;
Controls _controls;
PBD::ScopedConnectionList _list_connections;

Some files were not shown because too many files have changed in this diff Show More