commit 56e3b07cbd47e2fc2c70ac7969b4cd4b1e1007f4
parent 9d9cfa13d7a5ac5c8dacfb83f4d4c3de6ff26645
Author: Harald Hvaal <harald.hvaal@gmail.com>
Date: Sat, 19 Dec 2009 23:37:49 +0100
Merge commit 'origin/nio' into nio
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/Nio/OutMgr.cpp b/src/Nio/OutMgr.cpp
@@ -71,6 +71,7 @@ OutMgr::~OutMgr()
pthread_mutex_lock(&processing);
pthread_cond_signal(&needsProcess);
pthread_mutex_unlock(&processing);
+
pthread_mutex_lock(&close_m);
pthread_mutex_unlock(&close_m);
for(map<string,AudioOut*>::iterator itr = managedOuts.begin();
@@ -81,7 +82,6 @@ OutMgr::~OutMgr()
pthread_mutex_destroy(&mutex);
pthread_mutex_destroy(&processing);
pthread_cond_destroy(&needsProcess);
-#warning TODO deallocate Engines (or have possible issues)
}
void *_outputThread(void *arg)
@@ -123,7 +123,6 @@ void *OutMgr::outputThread()
smps = Stereo<Sample>(Sample(SOUND_BUFFER_SIZE, outl),
Sample(SOUND_BUFFER_SIZE, outr));
- pthread_mutex_unlock(&processing);
pthread_mutex_lock(&mutex);
if(false)
@@ -148,8 +147,8 @@ void *OutMgr::outputThread()
//wait for next run
--numRequests;
doWait = (numRequests()<1);
- pthread_mutex_lock(&processing);
if(doWait) {
+ pthread_mutex_lock(&processing);
pthread_cond_wait(&needsProcess, &processing);
pthread_mutex_unlock(&processing);
}
@@ -165,7 +164,6 @@ void *OutMgr::outputThread()
void OutMgr::run()
{
pthread_attr_t attr;
- //threadStop = false;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&outThread, &attr, _outputThread, this);