shithub: libvpx

Download patch

ref: a48d42a804a267b57b7c9a6390450731caedeea2
parent: 8cc525e82b639932870e4666c524420ff2c8536a
author: James Zern <jzern@google.com>
date: Fri Jul 1 10:31:23 EDT 2016

vpx_thread: use InitializeCriticalSectionEx if available

BUG=b/29583578

original webp change:

commit 63fadc9ffacc77d4617526a50c696d21d558a70b
Author: James Zern <jzern@google.com>
Date:   Mon Nov 23 20:38:46 2015 -0800

    thread: use InitializeCriticalSectionEx if available

    Windows Vista / Server 2008 and up

    Change-Id: I32c5b4e5384d614c5a821ef511293ff014c67966

100644 blob f84207d89b3a6bb98bfe8f3fa55cad72dfd061ff src/utils/thread.c
100644 blob 840831185502d42a3246e4b7ff870121c8064791 src/utils/thread.h

Change-Id: I9ce49b3a86857267e504cd8ceab503b7b441d614

--- a/vpx_util/vpx_thread.h
+++ b/vpx_util/vpx_thread.h
@@ -77,7 +77,11 @@
 static INLINE int pthread_mutex_init(pthread_mutex_t *const mutex,
                                      void* mutexattr) {
   (void)mutexattr;
+#if _WIN32_WINNT >= 0x0600  // Windows Vista / Server 2008 or greater
+  InitializeCriticalSectionEx(mutex, 0 /*dwSpinCount*/, 0 /*Flags*/);
+#else
   InitializeCriticalSection(mutex);
+#endif
   return 0;
 }