FreeRDP/FreeRDP — pull request #1397 by nfedera (2013-08-07 08:49:54+00:00)
Title: libwinpr-sync: New complete critical section code

- Complete implementation including recursion support
- Added an intensive ctest (TestSynchCritical)
- Struct members are used exactly as Windows does it internally:
LockCount starts at -1, RecursionCount at 0
- Same performance optimizations as internally on Windows:
- Fast lock acquisition path using CAS -> SpinCount -> wait
- SpinCount automatically disabled on uniprocessor systems
- On Linux SpinCount is disabled because it provided no advantage over NPTL/futex in all tests

Support for CRITICAL_SECTION's DebugInfo is not yet included (but trivial to add).