summaryrefslogtreecommitdiff
path: root/codec.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-07-06 03:01:41 +0200
committerGravatar waker <wakeroid@gmail.com>2009-07-06 03:01:41 +0200
commitd05d431ebad5767f3afa9b6c76639e83233e2d9c (patch)
tree0ab32f81a39f5ce3fab292892aee97ee1f85e6c5 /codec.c
parentb7a872069ad3990b65d8ebe6d53de8768841980f (diff)
fixed inter-thread conflict for codec access
Diffstat (limited to 'codec.c')
-rw-r--r--codec.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/codec.c b/codec.c
index e69de29b..5beaa43b 100644
--- a/codec.c
+++ b/codec.c
@@ -0,0 +1,25 @@
+#include "codec.h"
+#include "threading.h"
+
+static uintptr_t mutex;
+
+void
+codec_init_locking (void) {
+ mutex = mutex_create ();
+}
+
+void
+codec_free_locking (void) {
+ mutex_free (mutex);
+}
+
+void
+codec_lock (void) {
+ mutex_lock (mutex);
+}
+
+void
+codec_unlock (void) {
+ mutex_unlock (mutex);
+}
+