[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/core Peak.cpp Peak.h
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/core Peak.cpp Peak.h |
Date: |
Fri, 18 May 2007 10:40:58 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/05/18 10:40:58
Modified files:
src/core : Peak.cpp Peak.h
Log message:
* Use waitcondition to block gui thread on freeing a Peak when it is in
progress
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Peak.cpp?cvsroot=traverso&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Peak.h?cvsroot=traverso&r1=1.13&r2=1.14
Patches:
Index: Peak.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Peak.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- Peak.cpp 18 May 2007 10:13:41 -0000 1.26
+++ Peak.cpp 18 May 2007 10:40:58 -0000 1.27
@@ -709,9 +709,10 @@
m_taskRunning = false;
if (m_runningPeak->interuptPeakBuild) {
- printf("PeakProcessor:: Deleting interrupted Peak!\n");
+ PMESG("PeakProcessor:: Deleting interrupted Peak!");
delete m_runningPeak;
m_runningPeak = 0;
+ m_wait.wakeAll();
return;
}
@@ -754,20 +755,15 @@
m_queue.removeAll(peak);
if (peak == m_runningPeak) {
- printf("PeakProcessor:: Interrupting running build process!\n");
+ PMESG("PeakProcessor:: Interrupting running build process!");
peak->interuptPeakBuild = true;
- m_mutex.unlock();
-
- m_ppthread->exit(0);
- if (!m_ppthread->wait(500)) {
- printf("PeakProcessor:: Wait timed out!\n");
- }
+ PMESG("PeakProcessor:: Waiting GUI thread until interrupt
finished");
+ m_wait.wait(&m_mutex);
+ PMESG("PeakProcessor:: Resuming GUI thread");
- m_ppthread->start();
-
- m_mutex.lock();
dequeue_queue();
+
m_mutex.unlock();
return;
Index: Peak.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/Peak.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- Peak.h 18 May 2007 09:42:55 -0000 1.13
+++ Peak.h 18 May 2007 10:40:58 -0000 1.14
@@ -26,6 +26,7 @@
#include <QThread>
#include <QMutex>
#include <QQueue>
+#include <QWaitCondition>
#include "defines.h"
@@ -45,6 +46,7 @@
private:
PPThread* m_ppthread;
QMutex m_mutex;
+ QWaitCondition m_wait;
bool m_taskRunning;
Peak* m_runningPeak;