Skip to content

Commit

Permalink
Fix not releasing mutex in early return
Browse files Browse the repository at this point in the history
  • Loading branch information
qsantos committed Mar 8, 2024
1 parent 3fdf5dd commit 2c4a60d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions timeskew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ BOOL SkewedQueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) {
WaitForSingleObject(ghMutex, INFINITE);
BOOL ret = TrueQueryPerformanceCounter(lpPerformanceCount);
if (ret == 0) {
ReleaseMutex(ghMutex);
return ret;
}
static LONGLONG lastTrue = 0;
Expand Down Expand Up @@ -509,6 +510,7 @@ BOOL SkewedQueryUnbiasedInterruptTime(PULONGLONG UnbiasedTime) {
WaitForSingleObject(ghMutex, INFINITE);
BOOL ret = TrueQueryUnbiasedInterruptTime(UnbiasedTime);
if (ret == 0) {
ReleaseMutex(ghMutex);
return ret;
}
static ULONGLONG lastTrue = 0;
Expand Down

0 comments on commit 2c4a60d

Please sign in to comment.