]> granicus.if.org Git - libvpx/commitdiff
rtcd/win32: prefer win32 primatives to pthreads
authorJohn Koleszar <jkoleszar@google.com>
Mon, 24 Sep 2012 18:47:35 +0000 (11:47 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Mon, 24 Sep 2012 18:47:35 +0000 (11:47 -0700)
Fixes some build issues for people building for win32 who have a
pthreads emulation layer installed.

Change-Id: I0e0003fa01f65020f6ced35d961dcb1130db37a8

vp8/common/rtcd.c

index 4980f48ad95d60edbe55cf1333133b7a50494788..3150fff2616604cc704ea9eabc8a5d7f999aa88b 100644 (file)
 #define RTCD_C
 #include "vpx_rtcd.h"
 
-#if CONFIG_MULTITHREAD && HAVE_PTHREAD_H
-#include <pthread.h>
-static void once(void (*func)(void))
-{
-    static pthread_once_t lock = PTHREAD_ONCE_INIT;
-    pthread_once(&lock, func);
-}
-
-
-#elif CONFIG_MULTITHREAD && defined(_WIN32)
+#if CONFIG_MULTITHREAD && defined(_WIN32)
 #include <windows.h>
 static void once(void (*func)(void))
 {
@@ -44,6 +35,15 @@ static void once(void (*func)(void))
 }
 
 
+#elif CONFIG_MULTITHREAD && HAVE_PTHREAD_H
+#include <pthread.h>
+static void once(void (*func)(void))
+{
+    static pthread_once_t lock = PTHREAD_ONCE_INIT;
+    pthread_once(&lock, func);
+}
+
+
 #else
 /* No-op version that performs no synchronization. vpx_rtcd() is idempotent,
  * so as long as your platform provides atomic loads/stores of pointers