diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-10-25 05:50:21 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-10-25 05:50:21 +0000 |
commit | b81844b1738c584d92330a5ccd0fbd8b603d2886 (patch) | |
tree | 4fae0d4cd26048177fc5cd1a2dd91abc99ba0f99 /src/backend/access/transam/varsup.c | |
parent | 59da2105d8e6d95345b3b942a2e2aba8cead4838 (diff) | |
download | postgresql-b81844b1738c584d92330a5ccd0fbd8b603d2886.tar.gz postgresql-b81844b1738c584d92330a5ccd0fbd8b603d2886.zip |
pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
Diffstat (limited to 'src/backend/access/transam/varsup.c')
-rw-r--r-- | src/backend/access/transam/varsup.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index 048080a180f..5a56f47e064 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -6,7 +6,7 @@ * Copyright (c) 2000, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.46 2001/09/29 04:02:21 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.47 2001/10/25 05:49:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -32,7 +32,7 @@ VariableCache ShmemVariableCache = NULL; TransactionId GetNewTransactionId(void) { - TransactionId xid; + TransactionId xid; /* * During bootstrap initialization, we return the special bootstrap @@ -48,32 +48,32 @@ GetNewTransactionId(void) TransactionIdAdvance(ShmemVariableCache->nextXid); /* - * If we have just allocated the first XID of a new page of the - * commit log, zero out that commit-log page before returning. - * We must do this while holding XidGenLock, else another xact could - * acquire and commit a later XID before we zero the page. Fortunately, - * a page of the commit log holds 32K or more transactions, so we don't - * have to do this very often. + * If we have just allocated the first XID of a new page of the commit + * log, zero out that commit-log page before returning. We must do + * this while holding XidGenLock, else another xact could acquire and + * commit a later XID before we zero the page. Fortunately, a page of + * the commit log holds 32K or more transactions, so we don't have to + * do this very often. */ ExtendCLOG(xid); /* - * Must set MyProc->xid before releasing XidGenLock. This ensures that - * when GetSnapshotData calls ReadNewTransactionId, all active XIDs - * before the returned value of nextXid are already present in the shared - * PROC array. Else we have a race condition. + * Must set MyProc->xid before releasing XidGenLock. This ensures + * that when GetSnapshotData calls ReadNewTransactionId, all active + * XIDs before the returned value of nextXid are already present in + * the shared PROC array. Else we have a race condition. * * XXX by storing xid into MyProc without acquiring SInvalLock, we are * relying on fetch/store of an xid to be atomic, else other backends - * might see a partially-set xid here. But holding both locks at once - * would be a nasty concurrency hit (and in fact could cause a deadlock - * against GetSnapshotData). So for now, assume atomicity. Note that - * readers of PROC xid field should be careful to fetch the value only - * once, rather than assume they can read it multiple times and get the - * same answer each time. + * might see a partially-set xid here. But holding both locks at once + * would be a nasty concurrency hit (and in fact could cause a + * deadlock against GetSnapshotData). So for now, assume atomicity. + * Note that readers of PROC xid field should be careful to fetch the + * value only once, rather than assume they can read it multiple times + * and get the same answer each time. * - * A solution to the atomic-store problem would be to give each PROC - * its own spinlock used only for fetching/storing that PROC's xid. + * A solution to the atomic-store problem would be to give each PROC its + * own spinlock used only for fetching/storing that PROC's xid. * (SInvalLock would then mean primarily that PROCs couldn't be added/ * removed while holding the lock.) */ @@ -91,7 +91,7 @@ GetNewTransactionId(void) TransactionId ReadNewTransactionId(void) { - TransactionId xid; + TransactionId xid; /* * During bootstrap initialization, we return the special bootstrap @@ -117,16 +117,16 @@ static Oid lastSeenOid = InvalidOid; Oid GetNewObjectId(void) { - Oid result; + Oid result; LWLockAcquire(OidGenLock, LW_EXCLUSIVE); /* * Check for wraparound of the OID counter. We *must* not return 0 * (InvalidOid); and as long as we have to check that, it seems a good - * idea to skip over everything below BootstrapObjectIdData too. (This - * basically just reduces the odds of OID collision right after a wrap - * occurs.) Note we are relying on unsigned comparison here. + * idea to skip over everything below BootstrapObjectIdData too. + * (This basically just reduces the odds of OID collision right after + * a wrap occurs.) Note we are relying on unsigned comparison here. */ if (ShmemVariableCache->nextOid < ((Oid) BootstrapObjectIdData)) { |