summaryrefslogtreecommitdiff
path: root/sys/decklink
diff options
context:
space:
mode:
authorJoshua M. Doe <oss@nvl.army.mil>2011-07-07 14:13:00 -0400
committerDavid Schleef <ds@schleef.org>2011-08-21 18:59:49 -0700
commitc830cf3e66ad79a4bc5ca53e4435da24be1e2ea4 (patch)
treeaf48b3d1fe84bd58cee7ba231d703f4b6d654092 /sys/decklink
parent382346a6f39190ca72368c4a9e2bb2ef563a9842 (diff)
decklink: use mutexes from glib instead of pthread
Signed-off-by: David Schleef <ds@schleef.org>
Diffstat (limited to 'sys/decklink')
-rw-r--r--sys/decklink/capture.cpp13
-rw-r--r--sys/decklink/capture.h4
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/decklink/capture.cpp b/sys/decklink/capture.cpp
index 9a4b8bcf8..a888081db 100644
--- a/sys/decklink/capture.cpp
+++ b/sys/decklink/capture.cpp
@@ -28,7 +28,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <pthread.h>
#include <unistd.h>
#include <fcntl.h>
@@ -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 3c1ab4695..1a2497b0c 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