File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11
11
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
12
12
*
13
13
* IDENTIFICATION
14
- * $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.11 2006/08/09 20:40:56 momjian Exp $
14
+ * $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.12 2006/08/09 21:18:13 momjian Exp $
15
15
*
16
16
*-------------------------------------------------------------------------
17
17
*/
@@ -57,12 +57,9 @@ pg_timer_thread(LPVOID param)
57
57
waittime = INFINITE ; /* Cancel the interrupt */
58
58
else
59
59
{
60
- /* Minimum wait time is 1ms */
61
- if (timerCommArea .value .it_value .tv_sec == 0 &&
62
- timerCommArea .value .it_value .tv_usec < 1000 )
63
- timerCommArea .value .it_value .tv_usec = 1000 ;
64
- /* WaitForSingleObjectEx() uses milliseconds */
65
- waittime = timerCommArea .value .it_value .tv_usec / 1000 + timerCommArea .value .it_value .tv_sec * 1000 ;
60
+ /* WaitForSingleObjectEx() uses milliseconds, round up */
61
+ waittime = (timerCommArea .value .it_value .tv_usec + 999 ) / 1000 +
62
+ timerCommArea .value .it_value .tv_sec * 1000 ;
66
63
}
67
64
ResetEvent (timerCommArea .event );
68
65
LeaveCriticalSection (& timerCommArea .crit_sec );
You can’t perform that action at this time.
0 commit comments