Small winapi fixes

This commit is contained in:
Jacob Dufault 2017-03-20 23:03:59 -07:00
parent 95f6a0df1c
commit cd4d63dd9c

View File

@ -53,13 +53,13 @@ struct PlatformScopedMutexLockWin : public PlatformScopedMutexLock {
PlatformScopedMutexLockWin(HANDLE raw_mutex) : raw_mutex(raw_mutex) {
DWORD result = WaitForSingleObject(raw_mutex, INFINITE);
assert(result != WAIT_FAILED);
CheckForError({} /*allow*/);
assert(result == WAIT_OBJECT_0);
CheckForError({ ERROR_NO_MORE_FILES, ERROR_ALREADY_EXISTS } /*allow*/);
}
~PlatformScopedMutexLockWin() override {
ReleaseMutex(raw_mutex);
CheckForError({} /*allow*/);
CheckForError({ ERROR_NO_MORE_FILES, ERROR_ALREADY_EXISTS } /*allow*/);
}
};