diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-09-29 04:02:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-09-29 04:02:27 +0000 |
commit | 499abb0c0f21cb861c5af1d49a06469f3cfcc1eb (patch) | |
tree | 0af6262d9b6d1159315e93e90e69047b959ea5f5 /src/backend/utils/init/postinit.c | |
parent | 818fb55ac49b4b20e65d9899fc1784e54e86db58 (diff) | |
download | postgresql-499abb0c0f21cb861c5af1d49a06469f3cfcc1eb.tar.gz postgresql-499abb0c0f21cb861c5af1d49a06469f3cfcc1eb.zip |
Implement new 'lightweight lock manager' that's intermediate between
existing lock manager and spinlocks: it understands exclusive vs shared
lock but has few other fancy features. Replace most uses of spinlocks
with lightweight locks. All remaining uses of spinlocks have very short
lock hold times (a few dozen instructions), so tweak spinlock backoff
code to work efficiently given this assumption. All per my proposal on
pghackers 26-Sep-01.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r-- | src/backend/utils/init/postinit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 2a57a7acd74..47926b146f5 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.92 2001/09/27 16:29:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.93 2001/09/29 04:02:25 tgl Exp $ * * *------------------------------------------------------------------------- @@ -401,11 +401,12 @@ ShutdownPostgres(void) * since that just raises the odds of failure --- but there's some * stuff we need to do. * - * Release any spinlocks or buffer context locks we might be holding. + * Release any LW locks and buffer context locks we might be holding. * This is a kluge to improve the odds that we won't get into a - * self-made stuck-spinlock scenario while trying to shut down. + * self-made stuck-lock scenario while trying to shut down. */ - ProcReleaseSpins(NULL); + LWLockReleaseAll(); + AbortBufferIO(); UnlockBuffers(); /* |