diff options
author | Andres Freund | 2015-02-03 22:25:00 +0000 |
---|---|---|
committer | Andres Freund | 2015-02-03 22:25:00 +0000 |
commit | d06995710bc7e347d39866c1793ae282498d65e0 (patch) | |
tree | 5d4de1a97f5518baba36e0b68864ac84e67ceef0 /src/backend/port/posix_sema.c | |
parent | 6753333f55e1d9bcb9da4323556b456583624a07 (diff) |
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
Diffstat (limited to 'src/backend/port/posix_sema.c')
-rw-r--r-- | src/backend/port/posix_sema.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/backend/port/posix_sema.c b/src/backend/port/posix_sema.c index 633bf5afebb..ad9c80a8b5b 100644 --- a/src/backend/port/posix_sema.c +++ b/src/backend/port/posix_sema.c @@ -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) |