#include "ardour/session_event.h"
#include "ardour/transient_detector.h"
-#include "pbd/pthread_utils.h"
-#include "pbd/convert.h"
-
using namespace std;
-using namespace sigc;
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 ()
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
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
Analyser::work ()
{
- PBD::notify_gui_about_thread_creation (pthread_self(), string ("analyser-") + to_string (pthread_self(), std::dec));
SessionEvent::create_per_thread_pool ("Analyser", 64);
while (true) {
wait:
if (analysis_queue.empty()) {
- SourcesToAnalyse->wait (analysis_queue_lock);
+ SourcesToAnalyse.wait (analysis_queue_lock);
}
if (analysis_queue.empty()) {