Teached TIMER_GetNextExpiration that a timer that has already expired
(but not processed yet) HAS already expired...
This commit is contained in:
parent
538d4c8f5f
commit
0df0f1fd28
|
@ -195,10 +195,17 @@ static void TIMER_RestartTimer( TIMER * pTimer, DWORD curTime )
|
||||||
*/
|
*/
|
||||||
LONG TIMER_GetNextExpiration(void)
|
LONG TIMER_GetNextExpiration(void)
|
||||||
{
|
{
|
||||||
|
TIMER *pTimer;
|
||||||
LONG retValue;
|
LONG retValue;
|
||||||
|
|
||||||
EnterCriticalSection( &csTimer );
|
EnterCriticalSection( &csTimer );
|
||||||
retValue = pNextTimer ? EXPIRE_TIME( pNextTimer, GetTickCount() ) : -1;
|
|
||||||
|
pTimer = pNextTimer;
|
||||||
|
|
||||||
|
while (pTimer && !pTimer->expires) /* Skip already expired timers */
|
||||||
|
pTimer = pTimer->next;
|
||||||
|
|
||||||
|
retValue = pTimer ? EXPIRE_TIME( pTimer, GetTickCount() ) : -1;
|
||||||
LeaveCriticalSection( &csTimer );
|
LeaveCriticalSection( &csTimer );
|
||||||
|
|
||||||
return retValue;
|
return retValue;
|
||||||
|
|
Loading…
Reference in New Issue