mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Measure WaitLatch's timeout parameter in milliseconds, not microseconds.
The original definition had the problem that timeouts exceeding about 2100 seconds couldn't be specified on 32-bit machines. Milliseconds seem like sufficient resolution, and finer grain than that would be fantasy anyway on many platforms. Back-patch to 9.1 so that this aspect of the latch API won't change between 9.1 and later releases. Peter Geoghegan
This commit is contained in:
@@ -406,10 +406,11 @@ pgarch_MainLoop(void)
|
||||
timeout = PGARCH_AUTOWAKE_INTERVAL - (curtime - last_copy_time);
|
||||
if (timeout > 0)
|
||||
{
|
||||
int rc;
|
||||
int rc;
|
||||
|
||||
rc = WaitLatch(&mainloop_latch,
|
||||
WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH,
|
||||
timeout * 1000000L);
|
||||
timeout * 1000L);
|
||||
if (rc & WL_TIMEOUT)
|
||||
wakened = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user