Skip to content

Commit 77fe4fd

Browse files
committed
Use pg_usleep() not sleep(), per Andrew Dunstan.
1 parent 5d72ef8 commit 77fe4fd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/backend/postmaster/pgarch.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*
2121
* IDENTIFICATION
22-
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.10 2004/11/09 13:01:26 petere Exp $
22+
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.11 2004/11/17 17:50:20 tgl Exp $
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
@@ -338,15 +338,14 @@ pgarch_MainLoop(void)
338338

339339
/*
340340
* There shouldn't be anything for the archiver to do except to
341-
* wait for a signal, so we could use pause(3) here... ...however,
342-
* the archiver exists to protect our data, so she wakes up
343-
* occasionally to allow herself to be proactive. In particular
344-
* this avoids getting stuck if a signal arrives just before we
345-
* enter sleep().
341+
* wait for a signal, ... however, the archiver exists to
342+
* protect our data, so she wakes up occasionally to allow
343+
* herself to be proactive. In particular this avoids getting
344+
* stuck if a signal arrives just before we sleep.
346345
*/
347346
if (!wakened)
348347
{
349-
sleep(PGARCH_AUTOWAKE_INTERVAL);
348+
pg_usleep(PGARCH_AUTOWAKE_INTERVAL * 1000000L);
350349

351350
curtime = time(NULL);
352351
if ((unsigned int) (curtime - last_copy_time) >=

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy