To fix (mostly theoretical) race conditions where another thread may have just allocated a new file-descriptor, and we end up using a file-descriptor that doesn't belong to us.
Caught by Application Verifier (on Windows).
To fix (mostly theoretical) race conditions where another thread may have just allocated a new file-descriptor, and we end up using a file-descriptor that doesn't belong to us.
Caught by Application Verifier (on Windows).