Commit 32c6f1bacdb40f0d1b57aa6e8b2ce4eaf3979d08

Nick Mathewson 2010-02-15T19:54:15

Construct Windows locks using InitializeCriticalSectionAndSpinCount Previously we were using InitializeCriticalSection, which creates a lock that blocks immediately on contention and waits to be rescheduled. This is inefficient; it's better to wait for a little while before telling the US to reschedule us, in case the lock becomes available again really soon (since most locks mostly do). Good pthreads implementations do this automatically. On Windows, though, we need to call this magic function, and we need to pick the spin count ourselves.