1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Remove the option to service interrupts during PGSemaphoreLock().

The remaining caller (lwlocks) doesn't need that facility, and we plan
to remove ImmedidateInterruptOK entirely. That means that interrupts
can't be serviced race-free and portably anyway, so there's little
reason for keeping the feature.

Reviewed-By: Heikki Linnakangas
This commit is contained in:
Andres Freund
2015-02-03 23:25:00 +01:00
parent 6753333f55
commit d06995710b
5 changed files with 12 additions and 63 deletions

View File

@@ -236,22 +236,14 @@ PGSemaphoreReset(PGSemaphore sema)
* Lock a semaphore (decrement count), blocking if count would be < 0
*/
void
PGSemaphoreLock(PGSemaphore sema, bool interruptOK)
PGSemaphoreLock(PGSemaphore sema)
{
int errStatus;
/*
* See notes in sysv_sema.c's implementation of PGSemaphoreLock. Just as
* that code does for semop(), we handle both the case where sem_wait()
* returns errno == EINTR after a signal, and the case where it just keeps
* waiting.
*/
/* See notes in sysv_sema.c's implementation of PGSemaphoreLock. */
do
{
ImmediateInterruptOK = interruptOK;
CHECK_FOR_INTERRUPTS();
errStatus = sem_wait(PG_SEM_REF(sema));
ImmediateInterruptOK = false;
} while (errStatus < 0 && errno == EINTR);
if (errStatus < 0)