summaryrefslogtreecommitdiff
path: root/compat/w32pthreads.h
Commit message (Collapse)AuthorAge
* w32pthreads: Map MemoryBarrier to __sync_synchronize on mingwMartin Storsjö2015-10-30
| | | | | | | This fixes building on older mingw (both mingw.org and mingw64; mingw64 from before May 2011). Signed-off-by: Martin Storsjö <martin@martin.st>
* w32pthreads: fix mingw build on x86 with -msse2 or higherHendrik Leppkes2015-10-16
| | | | | | | | When SSE2 or higher compiler optimizations are used, mingw uses the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include the appropriate headers automatically. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* w32pthreads: Load dynamically loaded functions on demandHendrik Leppkes2015-10-07
| | | | | | | This removes the requirement of calling w32thread_init before being able to use the threading primitives. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* w32pthreads: Add pthread_once emulationHendrik Leppkes2015-10-07
| | | | | | | | The emulation uses native InitOnce* APIs on Windows Vista+, and a lock-free/allocation-free approach using atomics and spinning for Windows XP. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* w32pthreads: use the condition variable API directly when targeting newer ↵James Almer2014-10-10
| | | | | | | | | | versions of Windows Wrap the function calls in a similar fashion to how it's being done with the critical section API. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* w32pthreads: use the CONDITION_VARIABLE typedef if availableJames Almer2014-10-10
| | | | | | | | This silences warnings about passing arguments from incompatible pointer type when targeting Windows Vista or newer. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* w32pthreads: Mark functions in compatibility wrapper as av_unusedDiego Biurrun2014-08-15
| | | | | | This avoids annoying warnings about unused functions. The compatibility wrapper is designed to provide a complete (stub) API, so some functions being unused by some files is natural and no reason for a warning.
* w32threads: Use newer thread synchronization functions when targeting VistaMartin Storsjö2014-08-13
| | | | | | | | | | | | | | | | | When explicitly targeting Vista or newer (which only happens if the caller explicitly sets _WIN32_WINNT to a high enough value via the extra cflags option - otherwise configure script sets -D_WIN32_WINNT=0x0502), we already unconditionally link to the ConditionVariable functions, since 4622f11f9. Similarly use the newer -Ex versions of CreateEvent, CreateSemaphore, InitializeCriticalSection and WaitForSingleObject, that all appeared in Vista. When building Windows Store applications, the older versions of these functions aren't available, only the -Ex functions. When doing such a build, the user can set -D_WIN32_WINNT=0x0600 to forcibly use the newer functions instead. Signed-off-by: Martin Storsjö <martin@martin.st>
* Revert "w32pthread: help compiler figure out undeeded code"Martin Storsjö2013-08-27
| | | | | | | | | | This reverts commit 4622f11f9c83db8a2e08408c71ff901826ca652c. The compiler should be able to do the dead code elimination now without this when the cond_* names point directly to the real functions instead of to local function pointers. Signed-off-by: Martin Storsjö <martin@martin.st>
* w32threads: Don't use function pointers when linking directly to newer APIsMartin Storsjö2013-08-27
| | | | | | | | | | | | This reduces the call overhead slightly. More noticeably, it restores the earlier (unintended?) feature that condition variable functions work just fine even if w32thread_init() hasn't been called. This was broken as a side effect of 4622f11f9, if explicitly targeting Vista+. This makes w32threading work in VP8 again, if targeting Vista+. Signed-off-by: Martin Storsjö <martin@martin.st>
* w32pthread: help compiler figure out undeeded codeRafaël Carré2013-08-21
| | | | | | | | The emulation code is not needed when targetting Vista+ This helps getting rid of CreateSemaphore symbol, which is forbidden in Windows Store apps. Signed-off-by: Martin Storsjö <martin@martin.st>
* Employ consistent LIBAV_COMPAT_ multiple inclusion guards in compat/Diego Biurrun2013-07-18
| | | | Also fix a comment and an #endif comment.
* w32pthreads: move from lavc to compat/Anton Khirnov2013-05-24
It will be used in other places than lavc.