Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a7d3d0

Browse files
committed
Round microseconds on setitimer upwards.
1 parent0553a05 commit6a7d3d0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎src/backend/port/win32/timer.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.11 2006/08/0920:40:56 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.12 2006/08/0921:18:13 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -57,12 +57,9 @@ pg_timer_thread(LPVOID param)
5757
waittime=INFINITE;/* Cancel the interrupt */
5858
else
5959
{
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;
6663
}
6764
ResetEvent(timerCommArea.event);
6865
LeaveCriticalSection(&timerCommArea.crit_sec);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp