Revert "Add a couple of pthread helper macros"
[ardour.git] / libs / backends / wavesaudio / wavesapi / devicemanager / WCMRNativeAudio.cpp
index 642ea22de1f55b6304d4fbe51e8494184557063f..18811f7dc6f5aa4d76ddd1d5fde697bbe4a72acf 100644 (file)
@@ -12,8 +12,8 @@
 #endif
 
 #include "WCMRNativeAudio.h"
-#include "MiscUtils/pthread_utils.h"
 #include "MiscUtils/safe_delete.h"
+#include <iostream>
 #include <sstream>
 #include <boost/assign/list_of.hpp>
 
 //**********************************************************************************************
 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);
@@ -138,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;
@@ -157,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;
                }
@@ -221,7 +220,7 @@ void WCMRNativeAudioNoneDevice::_SilenceThread()
         }
                audioCallbackData.acdCycleStartTimeNanos = cycleEndTimeNanos+1;
     }
-       mark_pthread_inactive (m_SilenceThread);
+       m_SilenceThread = 0;
 }
 
 void* WCMRNativeAudioNoneDevice::__SilenceThread(void *This)