diff options
| author | Tom Lane | 2011-08-09 22:52:29 +0000 |
|---|---|---|
| committer | Tom Lane | 2011-08-09 22:52:29 +0000 |
| commit | 9f17ffd8660243382809b8023ff3d38fbfac4e8b (patch) | |
| tree | f58c4fa6f2509bb157dcad8ad4223673ed55d383 /src/backend/replication | |
| parent | 4e15a4db5e65e43271f8d20750d6500ab12632d0 (diff) | |
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
Diffstat (limited to 'src/backend/replication')
| -rw-r--r-- | src/backend/replication/syncrep.c | 2 | ||||
| -rw-r--r-- | src/backend/replication/walsender.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index 56af4237e80..7d7f340274b 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -251,7 +251,7 @@ SyncRepWaitForLSN(XLogRecPtr XactCommitLSN) * cancel/die signal or postmaster death regularly while waiting. Note * that timeout here does not necessarily release from loop. */ - WaitLatch(&MyProc->waitLatch, WL_LATCH_SET | WL_TIMEOUT, 60000000L); + WaitLatch(&MyProc->waitLatch, WL_LATCH_SET | WL_TIMEOUT, 60000L); } /* diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 7f83a32c0c4..27577529eb3 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -812,7 +812,7 @@ WalSndLoop(void) if (pq_is_send_pending()) wakeEvents |= WL_SOCKET_WRITEABLE; WaitLatchOrSocket(&MyWalSnd->latch, wakeEvents, - MyProcPort->sock, sleeptime * 1000L); + MyProcPort->sock, sleeptime); /* Check for replication timeout */ if (replication_timeout > 0 && |
