diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-02-10 03:42:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-02-10 03:42:45 +0000 |
commit | 58f337a3435cd6ac46dfca4ce1a44b837080745e (patch) | |
tree | 03e4a309f7ada6914474c02fd9b53df7ab1da975 /src/include/miscadmin.h | |
parent | 87bd95638552b8fc1f5f787ce5b862bb6fc2eb80 (diff) | |
download | postgresql-58f337a3435cd6ac46dfca4ce1a44b837080745e.tar.gz postgresql-58f337a3435cd6ac46dfca4ce1a44b837080745e.zip |
Centralize implementation of delay code by creating a pg_usleep()
subroutine in src/port/pgsleep.c. Remove platform dependencies from
miscadmin.h and put them in port.h where they belong. Extend recent
vacuum cost-based-delay patch to apply to VACUUM FULL, ANALYZE, and
non-btree index vacuuming.
By the way, where is the documentation for the cost-based-delay patch?
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r-- | src/include/miscadmin.h | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 7e9a209331e..b43d481c52a 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.152 2004/02/08 22:28:57 neilc Exp $ + * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.153 2004/02/10 03:42:45 tgl Exp $ * * NOTES * some of the information in this file should be moved to @@ -24,7 +24,6 @@ #define MISCADMIN_H - /***************************************************************************** * System interrupt and critical section handling * @@ -83,10 +82,10 @@ do { \ #else #define CHECK_FOR_INTERRUPTS() \ do { \ - WaitForSingleObjectEx(GetCurrentThread(),0,TRUE); \ + WaitForSingleObjectEx(GetCurrentThread(),0,TRUE); \ if (InterruptPending) \ ProcessInterrupts(); \ -} while (0) +} while(0) #endif @@ -106,34 +105,6 @@ do { \ CritSectionCount--; \ } while(0) -#ifndef WIN32 -#define PG_USLEEP(_usec) \ -do { \ - /* This will overflow on systems with 32-bit ints for > ~2000 secs */ \ - struct timeval delay; \ - \ - delay.tv_sec = (_usec) / 1000000; \ - delay.tv_usec = ((_usec) % 1000000); \ - (void) select(0, NULL, NULL, NULL, &delay); \ -} while(0) -#define PG_MSLEEP(_msec) \ -do { \ - struct timeval _delay; \ - _delay.tv_sec = (_msec) / 1000; \ - _delay.tv_usec = ((_msec) % 1000) * 1000; \ - (void) select (0, NULL, NULL, NULL, &_delay); \ -} while(0) -#else -#define PG_USLEEP(_usec) \ -do { \ - SleepEx(((_usec) < 500 ? 1 : ((_usec) + 500) / 1000), TRUE); \ -} while(0) -#define PG_MSLEEP(_msec) PG_USLEEP((_msec) * 1000) -#endif - -#ifdef WIN32 -#define ftruncate(a,b) chsize(a,b) -#endif /***************************************************************************** * globals.h -- * @@ -227,14 +198,14 @@ extern bool enableFsync; extern bool allowSystemTableMods; extern DLLIMPORT int work_mem; extern DLLIMPORT int maintenance_work_mem; -extern int VacuumMem; extern int VacuumCostPageHit; extern int VacuumCostPageMiss; extern int VacuumCostPageDirty; extern int VacuumCostLimit; -extern int VacuumCostBalance; extern int VacuumCostNaptime; + +extern int VacuumCostBalance; extern bool VacuumCostActive; /* |