And here follows a similar implementation using standard Windows semaphore primitives.
It might be slightly slower than the one above, since it's using a Windows Semaphore object instead
of locked increments. However, the code above requires Windows 2000 to run, and this doesn't.

For completeness, here is a wrapper for the native Windows Vista
Slim ReadWrite Lock. Just like the ones above, it's a simple semaphore
which doesn't support recursive locks nor upgrading of lock level.