mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
fix possible deadlock for OD.
Also comment related cleanups.
This commit is contained in:
parent
e0b92c441e
commit
bce418b19b
@ -259,12 +259,12 @@ void ODManager::Start()
|
||||
mTasksMutex.Lock();
|
||||
tasksInArray = mTasks.size()>0;
|
||||
mTasksMutex.Unlock();
|
||||
mCurrentThreadsMutex.Lock();
|
||||
|
||||
mPauseLock.Lock();
|
||||
paused=mPause;
|
||||
mPauseLock.Unlock();
|
||||
|
||||
mCurrentThreadsMutex.Lock();
|
||||
// keep adding tasks if there is work to do, up to the limit.
|
||||
while(!paused && tasksInArray && (mCurrentThreads < mMaxThreads))
|
||||
{
|
||||
|
@ -45,6 +45,7 @@ class ODManager
|
||||
public:
|
||||
///Gets the singleton instance - this is a function pointer that points to one of the below two instance calls.
|
||||
///Note that it is not a member function pointer since it is a static function.
|
||||
///the function pointer swapping is valid as long as the initial calls only happen from the main thread.
|
||||
static ODManager* (*Instance)();
|
||||
///Gets the singleton instance
|
||||
static ODManager* InstanceFirstTime();
|
||||
@ -192,6 +193,7 @@ class ODManagerHelperThread {
|
||||
static void *callback(void *p) {
|
||||
ODManagerHelperThread *th = (ODManagerHelperThread *)p;
|
||||
/* return (void *) */th->Entry();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///Specifies the priority the thread will run at. Currently doesn't work.
|
||||
|
Loading…
x
Reference in New Issue
Block a user