diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/access/transam/xact.c | 10 | ||||
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 6 | ||||
-rw-r--r-- | src/backend/storage/lmgr/s_lock.c | 9 |
3 files changed, 7 insertions, 18 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index c7725b0f621..56ecf9d2f43 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.159 2004/01/07 18:56:24 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.160 2004/01/09 21:08:46 momjian Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -561,13 +561,7 @@ RecordTransactionCommit(void) */ if (CommitDelay > 0 && enableFsync && CountActiveBackends() >= CommitSiblings) - { - struct timeval delay; - - delay.tv_sec = 0; - delay.tv_usec = CommitDelay; - (void) select(0, NULL, NULL, NULL, &delay); - } + PG_USLEEP(CommitDelay); XLogFlush(recptr); } diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 285617678a1..64c5800dc49 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.151 2004/01/07 18:56:27 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.152 2004/01/09 21:08:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1031,9 +1031,7 @@ BufferBackgroundWriter(void) * there was nothing to do at all. */ if (n > 0) - { - PG_DELAY(BgWriterDelay); - } + PG_USLEEP(BgWriterDelay * 1000); else sleep(10); } diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c index fac77aef0af..85d1a16516a 100644 --- a/src/backend/storage/lmgr/s_lock.c +++ b/src/backend/storage/lmgr/s_lock.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.23 2003/12/27 20:58:58 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.24 2004/01/09 21:08:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -19,7 +19,7 @@ #include <unistd.h> #include "storage/s_lock.h" - +#include "miscadmin.h" /* * s_lock_stuck() - complain about a stuck spinlock @@ -84,7 +84,6 @@ s_lock(volatile slock_t *lock, const char *file, int line) int spins = 0; int delays = 0; int cur_delay = MIN_DELAY_CSEC; - struct timeval delay; while (TAS(lock)) { @@ -97,9 +96,7 @@ s_lock(volatile slock_t *lock, const char *file, int line) if (++delays > NUM_DELAYS) s_lock_stuck(lock, file, line); - delay.tv_sec = cur_delay / 100; - delay.tv_usec = (cur_delay % 100) * 10000; - (void) select(0, NULL, NULL, NULL, &delay); + PG_USLEEP(cur_delay * 10000); #if defined(S_LOCK_TEST) fprintf(stdout, "*"); |