mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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.
This commit is contained in:
@ -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();
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user