mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 03:55:49 +00:00
Small winapi fixes
This commit is contained in:
parent
95f6a0df1c
commit
cd4d63dd9c
@ -53,13 +53,13 @@ struct PlatformScopedMutexLockWin : public PlatformScopedMutexLock {
|
|||||||
|
|
||||||
PlatformScopedMutexLockWin(HANDLE raw_mutex) : raw_mutex(raw_mutex) {
|
PlatformScopedMutexLockWin(HANDLE raw_mutex) : raw_mutex(raw_mutex) {
|
||||||
DWORD result = WaitForSingleObject(raw_mutex, INFINITE);
|
DWORD result = WaitForSingleObject(raw_mutex, INFINITE);
|
||||||
assert(result != WAIT_FAILED);
|
assert(result == WAIT_OBJECT_0);
|
||||||
CheckForError({} /*allow*/);
|
CheckForError({ ERROR_NO_MORE_FILES, ERROR_ALREADY_EXISTS } /*allow*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
~PlatformScopedMutexLockWin() override {
|
~PlatformScopedMutexLockWin() override {
|
||||||
ReleaseMutex(raw_mutex);
|
ReleaseMutex(raw_mutex);
|
||||||
CheckForError({} /*allow*/);
|
CheckForError({ ERROR_NO_MORE_FILES, ERROR_ALREADY_EXISTS } /*allow*/);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user