diff --git a/sys/decklink/capture.cpp b/sys/decklink/capture.cpp index 9a4b8bcf8c..a888081dbe 100644 --- a/sys/decklink/capture.cpp +++ b/sys/decklink/capture.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -49,20 +48,20 @@ static BMDTimecodeFormat g_timecodeFormat = 0; DeckLinkCaptureDelegate::DeckLinkCaptureDelegate ():m_refCount (0) { - pthread_mutex_init (&m_mutex, NULL); + m_mutex = g_mutex_new(); } DeckLinkCaptureDelegate::~DeckLinkCaptureDelegate () { - pthread_mutex_destroy (&m_mutex); + g_mutex_free (m_mutex); } ULONG DeckLinkCaptureDelegate::AddRef (void) { - pthread_mutex_lock (&m_mutex); + g_mutex_lock (m_mutex); m_refCount++; - pthread_mutex_unlock (&m_mutex); + g_mutex_unlock (m_mutex); return (ULONG) m_refCount; } @@ -70,9 +69,9 @@ DeckLinkCaptureDelegate::AddRef (void) ULONG DeckLinkCaptureDelegate::Release (void) { - pthread_mutex_lock (&m_mutex); + g_mutex_lock (m_mutex); m_refCount--; - pthread_mutex_unlock (&m_mutex); + g_mutex_unlock (m_mutex); if (m_refCount == 0) { delete this; diff --git a/sys/decklink/capture.h b/sys/decklink/capture.h index 3c1ab46951..1a2497b0c8 100644 --- a/sys/decklink/capture.h +++ b/sys/decklink/capture.h @@ -18,8 +18,8 @@ class DeckLinkCaptureDelegate : public IDeckLinkInputCallback void *priv; private: - ULONG m_refCount; - pthread_mutex_t m_mutex; + ULONG m_refCount; + GMutex *m_mutex; }; #endif