Replace Glib::Threads with PBD::Thread (1/2)
This commit is contained in:
parent
a8559c8741
commit
24bbf403b9
|
@ -51,17 +51,10 @@ Analyser::~Analyser ()
|
|||
{
|
||||
}
|
||||
|
||||
static void
|
||||
analyser_work ()
|
||||
{
|
||||
pthread_set_name ("Analyzer");
|
||||
Analyser::work ();
|
||||
}
|
||||
|
||||
void
|
||||
Analyser::init ()
|
||||
{
|
||||
Glib::Threads::Thread::create (sigc::ptr_fun (analyser_work));
|
||||
PBD::Thread::create (sigc::ptr_fun (&Analyser::work), "Analyzer");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -299,12 +299,12 @@ class LIBARDOUR_API AudioEngine : public PortManager, public SessionHandlePtr
|
|||
|
||||
std::string _last_backend_error_string;
|
||||
|
||||
Glib::Threads::Thread* _hw_reset_event_thread;
|
||||
PBD::Thread* _hw_reset_event_thread;
|
||||
GATOMIC_QUAL gint _hw_reset_request_count;
|
||||
Glib::Threads::Cond _hw_reset_condition;
|
||||
Glib::Threads::Mutex _reset_request_lock;
|
||||
GATOMIC_QUAL gint _stop_hw_reset_processing;
|
||||
Glib::Threads::Thread* _hw_devicelist_update_thread;
|
||||
PBD::Thread* _hw_devicelist_update_thread;
|
||||
GATOMIC_QUAL gint _hw_devicelist_update_count;
|
||||
Glib::Threads::Cond _hw_devicelist_update_condition;
|
||||
Glib::Threads::Mutex _devicelist_update_lock;
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
#include <set>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <glibmm/threads.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include "pbd/pthread_utils.h"
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "ardour/session_handle.h"
|
||||
|
@ -54,7 +54,7 @@ private:
|
|||
~AutomationWatch();
|
||||
|
||||
static AutomationWatch* _instance;
|
||||
Glib::Threads::Thread* _thread;
|
||||
PBD::Thread* _thread;
|
||||
samplepos_t _last_time;
|
||||
bool _run_thread;
|
||||
AutomationWatches automation_watches;
|
||||
|
|
|
@ -23,11 +23,10 @@
|
|||
#ifndef MIDI_PATCH_MANAGER_H_
|
||||
#define MIDI_PATCH_MANAGER_H_
|
||||
|
||||
#include <glibmm/threads.h>
|
||||
|
||||
#include "midi++/midnam_patch.h"
|
||||
|
||||
#include "pbd/event_loop.h"
|
||||
#include "pbd/pthread_utils.h"
|
||||
#include "pbd/signals.h"
|
||||
#include "pbd/search_path.h"
|
||||
|
||||
|
@ -173,7 +172,7 @@ private:
|
|||
Glib::Threads::Mutex _lock;
|
||||
bool no_patch_changed_messages;
|
||||
bool stop_thread;
|
||||
Glib::Threads::Thread* _midnam_load_thread;
|
||||
PBD::Thread* _midnam_load_thread;
|
||||
void load_midnams ();
|
||||
};
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <glibmm/threads.h>
|
||||
|
||||
#include "pbd/pthread_utils.h"
|
||||
#include "pbd/ringbuffer.h"
|
||||
#include "pbd/semutils.h"
|
||||
|
||||
|
@ -110,7 +109,7 @@ private:
|
|||
PBD::RingBuffer<uint8_t>* _responses;
|
||||
uint8_t* _response;
|
||||
PBD::Semaphore _sem;
|
||||
Glib::Threads::Thread* _thread;
|
||||
PBD::Thread* _thread;
|
||||
bool _exit;
|
||||
bool _synchronous;
|
||||
};
|
||||
|
|
|
@ -752,13 +752,13 @@ AudioEngine::start_hw_event_processing()
|
|||
if (_hw_reset_event_thread == 0) {
|
||||
g_atomic_int_set (&_hw_reset_request_count, 0);
|
||||
g_atomic_int_set (&_stop_hw_reset_processing, 0);
|
||||
_hw_reset_event_thread = Glib::Threads::Thread::create (boost::bind (&AudioEngine::do_reset_backend, this));
|
||||
_hw_reset_event_thread = PBD::Thread::create (boost::bind (&AudioEngine::do_reset_backend, this));
|
||||
}
|
||||
|
||||
if (_hw_devicelist_update_thread == 0) {
|
||||
g_atomic_int_set (&_hw_devicelist_update_count, 0);
|
||||
g_atomic_int_set (&_stop_hw_devicelist_processing, 0);
|
||||
_hw_devicelist_update_thread = Glib::Threads::Thread::create (boost::bind (&AudioEngine::do_devicelist_update, this));
|
||||
_hw_devicelist_update_thread = PBD::Thread::create (boost::bind (&AudioEngine::do_devicelist_update, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -199,10 +199,10 @@ AutomationWatch::timer ()
|
|||
void
|
||||
AutomationWatch::thread ()
|
||||
{
|
||||
pbd_set_thread_priority (pthread_self(), PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority() - 2);
|
||||
pbd_set_thread_priority (pthread_self(), PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority() - 2); // XXX
|
||||
pthread_set_name ("AutomationWatch");
|
||||
while (_run_thread) {
|
||||
Glib::usleep ((gulong) floor (Config->get_automation_interval_msecs() * 1000));
|
||||
Glib::usleep ((gulong) floor (Config->get_automation_interval_msecs() * 1000)); // TODO use pthread_cond_timedwait on _run_thread
|
||||
timer ();
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ AutomationWatch::set_session (Session* s)
|
|||
|
||||
if (_session) {
|
||||
_run_thread = true;
|
||||
_thread = Glib::Threads::Thread::create (boost::bind (&AutomationWatch::thread, this));
|
||||
_thread = PBD::Thread::create (boost::bind (&AutomationWatch::thread, this));
|
||||
|
||||
_session->TransportStateChange.connect_same_thread (transport_connection, boost::bind (&AutomationWatch::transport_state_change, this));
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ MidiPatchManager::load_midnams ()
|
|||
void
|
||||
MidiPatchManager::load_midnams_in_thread ()
|
||||
{
|
||||
_midnam_load_thread = Glib::Threads::Thread::create (sigc::mem_fun (*this, &MidiPatchManager::load_midnams));
|
||||
_midnam_load_thread = PBD::Thread::create (boost::bind (&MidiPatchManager::load_midnams, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -105,7 +105,7 @@ void
|
|||
SourceFactory::init ()
|
||||
{
|
||||
for (int n = 0; n < 2; ++n) {
|
||||
Glib::Threads::Thread::create (sigc::ptr_fun (::peak_thread_work));
|
||||
PBD::Thread::create (&peak_thread_work);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,7 @@ Worker::Worker(Workee* workee, uint32_t ring_size, bool threaded)
|
|||
, _synchronous(!threaded)
|
||||
{
|
||||
if (threaded) {
|
||||
_thread = Glib::Threads::Thread::create(
|
||||
sigc::mem_fun(*this, &Worker::run));
|
||||
_thread = PBD::Thread::create (boost::bind (&Worker::run, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ WaveViewDrawingThread::start ()
|
|||
{
|
||||
assert (!_thread);
|
||||
|
||||
_thread = Glib::Threads::Thread::create (sigc::ptr_fun (&WaveViewThreads::thread_proc));
|
||||
_thread = PBD::Thread::create (&WaveViewThreads::thread_proc);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <deque>
|
||||
|
||||
#include "pbd/pthread_utils.h"
|
||||
#include "waveview/wave_view.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
|
@ -298,7 +299,7 @@ private:
|
|||
void run ();
|
||||
|
||||
private:
|
||||
Glib::Threads::Thread* _thread;
|
||||
PBD::Thread* _thread;
|
||||
};
|
||||
|
||||
class WaveViewThreads {
|
||||
|
|
Loading…
Reference in New Issue