mirror of https://github.com/postgres/postgres
On Win32, make minimum setitimer() sleep be 1ms, so sleeps < 1ms aren't
rounded down to zero. Backpatch to 8.1.X.
This commit is contained in:
parent
64214a2f01
commit
0553a0507c
|
@ -11,7 +11,7 @@
|
||||||
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.10 2006/08/09 17:47:03 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.11 2006/08/09 20:40:56 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -56,8 +56,14 @@ pg_timer_thread(LPVOID param)
|
||||||
timerCommArea.value.it_value.tv_usec == 0)
|
timerCommArea.value.it_value.tv_usec == 0)
|
||||||
waittime = INFINITE; /* Cancel the interrupt */
|
waittime = INFINITE; /* Cancel the interrupt */
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
/* Minimum wait time is 1ms */
|
||||||
|
if (timerCommArea.value.it_value.tv_sec == 0 &&
|
||||||
|
timerCommArea.value.it_value.tv_usec < 1000)
|
||||||
|
timerCommArea.value.it_value.tv_usec = 1000;
|
||||||
/* WaitForSingleObjectEx() uses milliseconds */
|
/* WaitForSingleObjectEx() uses milliseconds */
|
||||||
waittime = timerCommArea.value.it_value.tv_usec / 1000 + timerCommArea.value.it_value.tv_sec * 1000;
|
waittime = timerCommArea.value.it_value.tv_usec / 1000 + timerCommArea.value.it_value.tv_sec * 1000;
|
||||||
|
}
|
||||||
ResetEvent(timerCommArea.event);
|
ResetEvent(timerCommArea.event);
|
||||||
LeaveCriticalSection(&timerCommArea.crit_sec);
|
LeaveCriticalSection(&timerCommArea.crit_sec);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue