diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index 33080864c..f69cba4b6 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -22,7 +22,6 @@ #include #include #include -#include #undef THREAD_PRIORITY_NORMAL @@ -75,52 +74,38 @@ class PLDBridge : public rtengine::ProgressListener { }; template -class ProgressConnector { +class ProgressConnector { sigc::signal0 opStart; sigc::signal0 opEnd; T retval; Glib::Thread *workThread; - Glib::Mutex* qMutex; static int emitEndSignal (void* data) { - // gdk_threads_enter (); + gdk_threads_enter (); sigc::signal0* opEnd = (sigc::signal0*) data; int r = opEnd->emit (); delete opEnd; - //gdk_threads_leave (); + gdk_threads_leave (); return r; } void workingThread () { - /// if (!qMutex) - // qMutex = new Glib::Mutex (); - - // qMutex->lock(); retval = opStart.emit (); g_idle_add (ProgressConnector::emitEndSignal, new sigc::signal0 (opEnd)); - // workThread = 0; - // qMutex->unlock(); + workThread = 0; } public: - ProgressConnector ():workThread( 0 ) , qMutex(NULL) { } + ProgressConnector ():workThread( 0 ) { } void startFunc (const sigc::slot0& startHandler, const sigc::slot0& endHandler ) { if( !workThread ){ opStart.connect (startHandler); opEnd.connect (endHandler); - // rtengine::batchThread->yield(); - workingThread(); - // workThread = Glib::Thread::create(sigc::mem_fun(*this, &ProgressConnector::workingThread), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + workThread = Glib::Thread::create(sigc::mem_fun(*this, &ProgressConnector::workingThread), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); } - - if (qMutex) - { - delete qMutex; - qMutex = NULL; - } } T returnValue(){