Revert "Add a couple of pthread helper macros"

This reverts commit 8d0ec2403f.
This commit is contained in:
John Emmas 2014-09-09 08:26:26 +01:00
parent 3132a184f2
commit 83b6825bd0
4 changed files with 6 additions and 65 deletions

View file

@ -12,7 +12,6 @@
#endif
#include "WCMRNativeAudio.h"
#include "MiscUtils/pthread_utils.h"
#include "MiscUtils/safe_delete.h"
#include <iostream>
#include <sstream>
@ -35,12 +34,11 @@
//**********************************************************************************************
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);
@ -139,7 +137,7 @@ WTErr WCMRNativeAudioNoneDevice::SetStreaming (bool newState)
if (Streaming())
{
if (is_pthread_active (m_SilenceThread))
if (m_SilenceThread)
std::cerr << "\t\t\t\t\t !!!!!!!!!!!!!!! Warning: the inactive NONE-DEVICE was streaming!" << std::endl;
pthread_attr_t attributes;
@ -158,19 +156,19 @@ WTErr WCMRNativeAudioNoneDevice::SetStreaming (bool newState)
}
if (pthread_create (&m_SilenceThread, &attributes, __SilenceThread, this)) {
mark_pthread_inactive (m_SilenceThread);
m_SilenceThread = 0;
std::cerr << "WCMRNativeAudioNoneDevice::SetStreaming (): pthread_create () failed!" << std::endl;
return eGenericErr;
}
}
else
{
if (!is_pthread_active (m_SilenceThread))
if (!m_SilenceThread)
{
std::cerr << "\t\t\t\t\t !!!!!!!!!!!!!!! Warning: the active NONE-DEVICE was NOT streaming!" << std::endl;
}
while (is_pthread_active (m_SilenceThread))
while (m_SilenceThread)
{
_usleep(1); //now wait for ended thread;
}
@ -222,7 +220,7 @@ void WCMRNativeAudioNoneDevice::_SilenceThread()
}
audioCallbackData.acdCycleStartTimeNanos = cycleEndTimeNanos+1;
}
mark_pthread_inactive (m_SilenceThread);
m_SilenceThread = 0;
}
void* WCMRNativeAudioNoneDevice::__SilenceThread(void *This)