You know things are bad when the least awful implementation of OS-level locking is the one from Microsoft.