diff options
author | John Emmas <johne53@tiscali.co.uk> | 2014-09-09 12:05:14 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2014-09-09 12:05:14 +0100 |
commit | 16b25a3028505f02fe9bc58b765e9e638bc2a1ef (patch) | |
tree | a42d133e8c7f9df7f25c33d056c9b1e361dc5c11 /libs/backends | |
parent | 61e0705a949dee7e2fff753bbb5cbd78ef54febe (diff) |
Implement the new pthread macros (for the Waves audio backend)
Diffstat (limited to 'libs/backends')
-rw-r--r-- | libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp index 18811f7dc6..889defe0ad 100644 --- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp +++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp @@ -12,6 +12,7 @@ #endif #include "WCMRNativeAudio.h" +#include "MiscUtils/pthread_utils.h" #include "MiscUtils/safe_delete.h" #include <iostream> #include <sstream> @@ -34,11 +35,12 @@ //********************************************************************************************** WCMRNativeAudioNoneDevice::WCMRNativeAudioNoneDevice (WCMRAudioDeviceManager *pManager) : WCMRNativeAudioDevice (pManager, false /*useMultiThreading*/) - , m_SilenceThread(0) #if defined (PLATFORM_WINDOWS) , _waitableTimerForUsleep (CreateWaitableTimer(NULL, TRUE, NULL)) #endif { + mark_pthread_inactive (m_SilenceThread); + m_DeviceName = NONE_DEVICE_NAME; m_SamplingRates = boost::assign::list_of (m_CurrentSamplingRate=44100)(48000)(88200)(96000); @@ -137,7 +139,7 @@ WTErr WCMRNativeAudioNoneDevice::SetStreaming (bool newState) if (Streaming()) { - if (m_SilenceThread) + if (is_pthread_active (m_SilenceThread)) std::cerr << "\t\t\t\t\t !!!!!!!!!!!!!!! Warning: the inactive NONE-DEVICE was streaming!" << std::endl; pthread_attr_t attributes; @@ -156,19 +158,19 @@ WTErr WCMRNativeAudioNoneDevice::SetStreaming (bool newState) } if (pthread_create (&m_SilenceThread, &attributes, __SilenceThread, this)) { - m_SilenceThread = 0; + mark_pthread_inactive (m_SilenceThread); std::cerr << "WCMRNativeAudioNoneDevice::SetStreaming (): pthread_create () failed!" << std::endl; return eGenericErr; } } else { - if (!m_SilenceThread) + if (!is_pthread_active (m_SilenceThread)) { std::cerr << "\t\t\t\t\t !!!!!!!!!!!!!!! Warning: the active NONE-DEVICE was NOT streaming!" << std::endl; } - while (m_SilenceThread) + while (is_pthread_active (m_SilenceThread)) { _usleep(1); //now wait for ended thread; } @@ -220,7 +222,7 @@ void WCMRNativeAudioNoneDevice::_SilenceThread() } audioCallbackData.acdCycleStartTimeNanos = cycleEndTimeNanos+1; } - m_SilenceThread = 0; + mark_pthread_inactive (m_SilenceThread); } void* WCMRNativeAudioNoneDevice::__SilenceThread(void *This) |