summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc
diff options
context:
space:
mode:
authorTom Lane2001-01-19 22:08:47 +0000
committerTom Lane2001-01-19 22:08:47 +0000
commit6ce0ed2813ddcbb41a7199222fe0d2109fc5a5b4 (patch)
tree65e761d2289a6f4a88469fc7fdfc1dfcdfa03a90 /src/backend/storage/ipc
parent75815c31009d84171d46bcaef603bcd0cecd4446 (diff)
Make critical sections (elog->crash) and interrupt holdoff sections
into distinct concepts, per recent discussion on pghackers.
Diffstat (limited to 'src/backend/storage/ipc')
-rw-r--r--src/backend/storage/ipc/ipc.c5
-rw-r--r--src/backend/storage/ipc/spin.c18
2 files changed, 12 insertions, 11 deletions
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c
index 9d796299dc6..aa065cbe9a8 100644
--- a/src/backend/storage/ipc/ipc.c
+++ b/src/backend/storage/ipc/ipc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.60 2001/01/14 05:08:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.61 2001/01/19 22:08:46 tgl Exp $
*
* NOTES
*
@@ -136,7 +136,8 @@ proc_exit(int code)
QueryCancelPending = false;
/* And let's just make *sure* we're not interrupted ... */
ImmediateInterruptOK = false;
- CritSectionCount = 1;
+ InterruptHoldoffCount = 1;
+ CritSectionCount = 0;
if (DebugLvl > 1)
elog(DEBUG, "proc_exit(%d)", code);
diff --git a/src/backend/storage/ipc/spin.c b/src/backend/storage/ipc/spin.c
index b27c1810020..182ab976996 100644
--- a/src/backend/storage/ipc/spin.c
+++ b/src/backend/storage/ipc/spin.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.29 2001/01/14 05:08:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.30 2001/01/19 22:08:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -148,19 +148,19 @@ SpinAcquire(SPINLOCK lockid)
PRINT_SLDEBUG("SpinAcquire", lockid, slckP);
/*
* Acquire the lock, then record that we have done so (for recovery
- * in case of elog(ERROR) during the critical section). Note we assume
+ * in case of elog(ERROR) while holding the lock). Note we assume
* here that S_LOCK will not accept cancel/die interrupts once it has
* acquired the lock. However, interrupts should be accepted while
- * waiting, if CritSectionCount is zero.
+ * waiting, if InterruptHoldoffCount is zero.
*/
S_LOCK(&(slckP->shlock));
PROC_INCR_SLOCK(lockid);
/*
- * Lock out cancel/die interrupts until we exit the critical section
+ * Lock out cancel/die interrupts until we exit the code section
* protected by the spinlock. This ensures that interrupts will not
* interfere with manipulations of data structures in shared memory.
*/
- START_CRIT_SECTION();
+ HOLD_INTERRUPTS();
PRINT_SLDEBUG("SpinAcquire/done", lockid, slckP);
}
@@ -182,9 +182,9 @@ SpinRelease(SPINLOCK lockid)
PROC_DECR_SLOCK(lockid);
S_UNLOCK(&(slckP->shlock));
/*
- * Exit the critical section entered in SpinAcquire().
+ * Exit the interrupt holdoff entered in SpinAcquire().
*/
- END_CRIT_SECTION();
+ RESUME_INTERRUPTS();
PRINT_SLDEBUG("SpinRelease/done", lockid, slckP);
}
@@ -329,7 +329,7 @@ SpinAcquire(SPINLOCK lock)
*/
IpcSemaphoreLock(SpinLockIds[0], lock, false);
PROC_INCR_SLOCK(lock);
- START_CRIT_SECTION();
+ HOLD_INTERRUPTS();
}
/*
@@ -351,7 +351,7 @@ SpinRelease(SPINLOCK lock)
Assert(!MyProc || MyProc->sLocks[lockid] > 0);
PROC_DECR_SLOCK(lock);
IpcSemaphoreUnlock(SpinLockIds[0], lock);
- END_CRIT_SECTION();
+ RESUME_INTERRUPTS();
}
/*