diff options
| author | Bruce Momjian <bruce@momjian.us> | 1997-08-19 21:40:56 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1997-08-19 21:40:56 +0000 |
| commit | 1d8bbfd2e7cfb72cbe4d5c5d4fa650a28dedac0b (patch) | |
| tree | 8d3a5dac9207f22c3afb8afb563d54f88774deb3 /src/backend/storage/ipc/spin.c | |
| parent | b992e200b8872ecb6652ec85111995f8d4c5aee0 (diff) | |
| download | postgresql-1d8bbfd2e7cfb72cbe4d5c5d4fa650a28dedac0b.tar.gz | |
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
Diffstat (limited to 'src/backend/storage/ipc/spin.c')
| -rw-r--r-- | src/backend/storage/ipc/spin.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/backend/storage/ipc/spin.c b/src/backend/storage/ipc/spin.c index 4246b36b09..118a597ff8 100644 --- a/src/backend/storage/ipc/spin.c +++ b/src/backend/storage/ipc/spin.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.4 1997/01/14 01:53:11 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.5 1997/08/19 21:33:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -49,13 +49,6 @@ CreateSpinlocks(IPCKey key) } bool -AttachSpinLocks(IPCKey key) -{ - /* the spin lock shared memory must have been attached by now */ - return(TRUE); -} - -bool InitSpinLocks(int init, IPCKey key) { extern SPINLOCK ShmemLock; @@ -100,16 +93,26 @@ SpinRelease(SPINLOCK lock) ExclusiveUnlock(lock); } -bool +#else /* HAS_TEST_AND_SET */ +/* Spinlocks are implemented using SysV semaphores */ + +static bool AttachSpinLocks(IPCKey key); +static bool SpinIsLocked(SPINLOCK lock); + + +static bool +AttachSpinLocks(IPCKey key) +{ + /* the spin lock shared memory must have been attached by now */ + return(TRUE); +} + +static bool SpinIsLocked(SPINLOCK lock) { return(!LockIsFree(lock)); } -#else /* HAS_TEST_AND_SET */ -/* Spinlocks are implemented using SysV semaphores */ - - /* * SpinAcquire -- try to grab a spinlock * @@ -135,7 +138,7 @@ SpinRelease(SPINLOCK lock) IpcSemaphoreUnlock(SpinLockId, lock, IpcExclusiveLock); } -bool +static bool SpinIsLocked(SPINLOCK lock) { int semval; @@ -176,7 +179,7 @@ CreateSpinlocks(IPCKey key) /* * Attach to existing spinlock set */ -bool +static bool AttachSpinLocks(IPCKey key) { IpcSemaphoreId id; |
