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

« back to all changes in this revision

Viewing changes to src/backend/storage/ipc/sinval.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
 *
9
9
 *
10
10
 * IDENTIFICATION
11
 
 *        $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.89 2009/01/01 17:23:47 momjian Exp $
 
11
 *        $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.90 2009/06/11 14:49:02 momjian Exp $
12
12
 *
13
13
 *-------------------------------------------------------------------------
14
14
 */
65
65
 * NOTE: it is entirely possible for this routine to be invoked recursively
66
66
 * as a consequence of processing inside the invalFunction or resetFunction.
67
67
 * Furthermore, such a recursive call must guarantee that all outstanding
68
 
 * inval messages have been processed before it exits.  This is the reason
 
68
 * inval messages have been processed before it exits.  This is the reason
69
69
 * for the strange-looking choice to use a statically allocated buffer array
70
70
 * and counters; it's so that a recursive call can process messages already
71
71
 * sucked out of sinvaladt.c.
77
77
{
78
78
#define MAXINVALMSGS 32
79
79
        static SharedInvalidationMessage messages[MAXINVALMSGS];
 
80
 
80
81
        /*
81
 
         * We use volatile here to prevent bugs if a compiler doesn't realize
82
 
         * that recursion is a possibility ...
 
82
         * We use volatile here to prevent bugs if a compiler doesn't realize that
 
83
         * recursion is a possibility ...
83
84
         */
84
85
        static volatile int nextmsg = 0;
85
86
        static volatile int nummsgs = 0;
121
122
                }
122
123
 
123
124
                /*
124
 
                 * We only need to loop if the last SIGetDataEntries call (which
125
 
                 * might have been within a recursive call) returned a full buffer.
 
125
                 * We only need to loop if the last SIGetDataEntries call (which might
 
126
                 * have been within a recursive call) returned a full buffer.
126
127
                 */
127
128
        } while (nummsgs == MAXINVALMSGS);
128
129
 
129
130
        /*
130
131
         * We are now caught up.  If we received a catchup signal, reset that
131
 
         * flag, and call SICleanupQueue().  This is not so much because we
132
 
         * need to flush dead messages right now, as that we want to pass on
133
 
         * the catchup signal to the next slowest backend.  "Daisy chaining" the
134
 
         * catchup signal this way avoids creating spikes in system load for
135
 
         * what should be just a background maintenance activity.
 
132
         * flag, and call SICleanupQueue().  This is not so much because we need
 
133
         * to flush dead messages right now, as that we want to pass on the
 
134
         * catchup signal to the next slowest backend.  "Daisy chaining" the
 
135
         * catchup signal this way avoids creating spikes in system load for what
 
136
         * should be just a background maintenance activity.
136
137
         */
137
138
        if (catchupInterruptOccurred)
138
139
        {