audacia/src/ondemand/ODTaskThread.cpp

49 lines
955 B
C++
Raw Permalink Normal View History

/**********************************************************************
Audacity: A Digital Audio Editor
ODTaskThread.cpp
2014-06-03 20:30:19 +00:00
Created by Michael Chinen (mchinen) on 6/8/08
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
License: GPL v2. See License.txt.
******************************************************************//**
\class ODTaskThread
2021-01-12 09:54:34 +00:00
\brief A thread that executes a part of the task specified by an ODTask.
*//*******************************************************************/
#include "ODTaskThread.h"
#ifdef __WXMAC__
ODCondition::ODCondition(ODLock *lock)
{
pthread_cond_init(&condition, NULL);
m_lock=lock;
}
ODCondition::~ODCondition()
{
pthread_cond_destroy (&condition);
}
void ODCondition::Signal()
{
pthread_cond_signal(&condition);
}
2014-06-03 20:30:19 +00:00
void ODCondition::Broadcast()
{
pthread_cond_broadcast(&condition);
}
void ODCondition::Wait()
{
pthread_cond_wait(&condition, &m_lock->mutex);
}
2014-06-03 20:30:19 +00:00
#endif