From 7f60b81e1ab7cbb27298e980f25445dfa58d50bb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 29 Dec 2000 21:31:21 +0000 Subject: Fix failure in CreateCheckPoint on some Alpha boxes --- it's not OK to assume that TAS() will always succeed the first time, even if the lock is known to be free. Also, make sure that code will eventually time out and report a stuck spinlock, rather than looping forever. Small cleanups in s_lock.h, too. --- src/backend/storage/buffer/bufmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/storage/buffer/bufmgr.c') diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 2adea99e82c..d97ddfdbff4 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.100 2000/12/28 13:00:21 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.101 2000/12/29 21:31:21 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1987,7 +1987,7 @@ LockBuffer(Buffer buffer, int mode) while (buf->ri_lock || buf->w_lock) { S_UNLOCK(&(buf->cntx_lock)); - s_lock_sleep(i++); + S_LOCK_SLEEP(&(buf->cntx_lock), i++); S_LOCK(&(buf->cntx_lock)); } (buf->r_locks)++; @@ -2013,7 +2013,7 @@ LockBuffer(Buffer buffer, int mode) buf->ri_lock = true; } S_UNLOCK(&(buf->cntx_lock)); - s_lock_sleep(i++); + S_LOCK_SLEEP(&(buf->cntx_lock), i++); S_LOCK(&(buf->cntx_lock)); } buf->w_lock = true; -- cgit v1.2.3