~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to src/backend/port/sysv_sema.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 * Portions Copyright (c) 1994, Regents of the University of California
9
9
 *
10
10
 * IDENTIFICATION
11
 
 *        $PostgreSQL: pgsql/src/backend/port/sysv_sema.c,v 1.24 2009/01/01 17:23:46 momjian Exp $
 
11
 *        $PostgreSQL: pgsql/src/backend/port/sysv_sema.c,v 1.25 2009/06/11 14:49:00 momjian Exp $
12
12
 *
13
13
 *-------------------------------------------------------------------------
14
14
 */
377
377
         * from the operation prematurely because we were sent a signal.  So we
378
378
         * try and lock the semaphore again.
379
379
         *
380
 
         * Each time around the loop, we check for a cancel/die interrupt.  On
381
 
         * some platforms, if such an interrupt comes in while we are waiting,
382
 
         * it will cause the semop() call to exit with errno == EINTR, allowing
383
 
         * us to service the interrupt (if not in a critical section already)
384
 
         * during the next loop iteration.
 
380
         * Each time around the loop, we check for a cancel/die interrupt.      On
 
381
         * some platforms, if such an interrupt comes in while we are waiting, it
 
382
         * will cause the semop() call to exit with errno == EINTR, allowing us to
 
383
         * service the interrupt (if not in a critical section already) during the
 
384
         * next loop iteration.
385
385
         *
386
386
         * Once we acquire the lock, we do NOT check for an interrupt before
387
387
         * returning.  The caller needs to be able to record ownership of the lock
407
407
         *
408
408
         * On some platforms, signals marked SA_RESTART (which is most, for us)
409
409
         * will not interrupt the semop(); it will just keep waiting.  Therefore
410
 
         * it's necessary for cancel/die interrupts to be serviced directly by
411
 
         * the signal handler.  On these platforms the behavior is really the same
 
410
         * it's necessary for cancel/die interrupts to be serviced directly by the
 
411
         * signal handler.      On these platforms the behavior is really the same
412
412
         * whether the signal arrives just before the semop() begins, or while it
413
 
         * is waiting.  The loop on EINTR is thus important only for other types
 
413
         * is waiting.  The loop on EINTR is thus important only for other types
414
414
         * of interrupts.
415
415
         */
416
416
        do