Skip to content

Commit

Permalink
Fix unneeded use of mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
qsantos committed Mar 8, 2024
1 parent 2c4a60d commit 4eb080e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions timeskew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ BOOL SkewedSetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG

BOOL SkewedSetWaitableTimerEx(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, ULONG TolerableDelay) {
log("SkewedSetWaitableTimerEx(%lld, %ld)", lpDueTime->QuadPart, lPeriod);
WaitForSingleObject(ghMutex, INFINITE);
LARGE_INTEGER lpSkewedDueTime;
if (lpDueTime->QuadPart >= 0) {
// TODO: using lastSkewedDateTime without updating it might not be very reliable
Expand All @@ -379,7 +378,6 @@ BOOL SkewedSetWaitableTimerEx(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LON
// relative time
lpSkewedDueTime.QuadPart = lpDueTime->QuadPart * denom / num;
}
ReleaseMutex(ghMutex);
log("TrueSetWaitableTimerEx(%lld)", lpSkewedDueTime.QuadPart);
return TrueSetWaitableTimerEx(hTimer, &lpSkewedDueTime, lPeriod * denom / num, pfnCompletionRoutine, lpArgToCompletionRoutine, WakeContext, TolerableDelay);
}
Expand Down

0 comments on commit 4eb080e

Please sign in to comment.