/*
* There shouldn't be anything for the archiver to do except to
- * wait for a signal, so we could use pause(3) here... ...however,
- * the archiver exists to protect our data, so she wakes up
- * occasionally to allow herself to be proactive. In particular
- * this avoids getting stuck if a signal arrives just before we
- * enter sleep().
+ * wait for a signal, ... however, the archiver exists to
+ * protect our data, so she wakes up occasionally to allow
+ * herself to be proactive. In particular this avoids getting
+ * stuck if a signal arrives just before we sleep.
*/
if (!wakened)
{
- sleep(PGARCH_AUTOWAKE_INTERVAL);
+ pg_usleep(PGARCH_AUTOWAKE_INTERVAL * 1000000L);
curtime = time(NULL);
if ((unsigned int) (curtime - last_copy_time) >=