shithub: libvpx

Download patch

ref: 0211cd899a359538feef4f21b41c152d0a4cace3
parent: b501251e2e7a4db4cb1ca2d6cbf24176d2a065dc
author: John Koleszar <jkoleszar@google.com>
date: Mon Sep 24 07:47:35 EDT 2012

rtcd/win32: prefer win32 primatives to pthreads

Fixes some build issues for people building for win32 who have a
pthreads emulation layer installed.

Change-Id: I0e0003fa01f65020f6ced35d961dcb1130db37a8

--- a/vp8/common/rtcd.c
+++ b/vp8/common/rtcd.c
@@ -11,16 +11,7 @@
 #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))
 {
@@ -41,6 +32,15 @@
     }
 
     LeaveCriticalSection(&lock);
+}
+
+
+#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);
 }