Patch by Nils Maier <maierman@web.de>
Subject: [PATCH] Fix potential busy-waits/deadlocks because of r5491

r5491 removed some special handling of EINVAL from sem.c, which turned
out to cause something what looks like a period of busy waiting followed
by a deadlock in some code using pthreads. Code in question is a library
using ffmpeg as a pthreads caller, without using pthreads itself.

After git-bisecting this to r5491, and adding back the removed lines,
the error goes way.


git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@6366 4407c894-4637-0410-b4f5-ada5f102cad1
Nils Maier  <maierman@users.sf.net>

Implement spinlocks using CRITICAL_SECTION.

This fixes some issues on i686, where there were instanced observed where
the spinlock incorrectly got into an infinite, busy loop.

Also, this fixes code generation issues on i686 when compiling with
-msse2 or similar yielded incorrect register allocation in the inline
assembler code (the code is gone now).

The test_pthread test suite passes (tested x86_64 GC and GC-static), with
one change to fix the bogus spin3 test.
The create2 test is still wonky, but it was so even before this change.



git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@6367 4407c894-4637-0410-b4f5-ada5f102cad1
Remove unused spinlock.h header


git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@6368 4407c894-4637-0410-b4f5-ada5f102cad1