diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-10 12:20:45 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-10 12:20:45 -0400 |
commit | 989f530d3f793ed1c990d705d0958bfd2a533b85 (patch) | |
tree | a6676b9e587c9caf40b0e8dfd99bbd6bab4dd35f /src/include | |
parent | 74d099494c5853a44188316ba117a8909b299d40 (diff) | |
download | postgresql-989f530d3f793ed1c990d705d0958bfd2a533b85.tar.gz postgresql-989f530d3f793ed1c990d705d0958bfd2a533b85.zip |
Back-patch assorted latch-related fixes.
Fix a whole bunch of signal handlers that had been hacked to do things that
might change errno, without adding the necessary save/restore logic for
errno. Also make some minor fixes in unix_latch.c, and clean up bizarre
and unsafe scheme for disowning the process's latch. While at it, rename
the PGPROC latch field to procLatch for consistency with 9.2.
Issues noted while reviewing a patch by Peter Geoghegan.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/replication/syncrep.h | 4 | ||||
-rw-r--r-- | src/include/storage/proc.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/include/replication/syncrep.h b/src/include/replication/syncrep.h index efbebbcc06e..d71047e1470 100644 --- a/src/include/replication/syncrep.h +++ b/src/include/replication/syncrep.h @@ -33,8 +33,8 @@ extern char *SyncRepStandbyNames; /* called by user backend */ extern void SyncRepWaitForLSN(XLogRecPtr XactCommitLSN); -/* callback at backend exit */ -extern void SyncRepCleanupAtProcExit(int code, Datum arg); +/* called at backend exit */ +extern void SyncRepCleanupAtProcExit(void); /* called by wal sender */ extern void SyncRepInitConfig(void); diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index af9c1292fc8..56758da04f2 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -118,13 +118,14 @@ struct PGPROC LOCKMASK heldLocks; /* bitmask for lock types already held on this * lock object by this backend */ + Latch procLatch; /* generic latch for process */ + /* * Info to allow us to wait for synchronous replication, if needed. * waitLSN is InvalidXLogRecPtr if not waiting; set only by user backend. * syncRepState must not be touched except by owning process or WALSender. * syncRepLinks used only while holding SyncRepLock. */ - Latch waitLatch; /* allow us to wait for sync rep */ XLogRecPtr waitLSN; /* waiting for this LSN or higher */ int syncRepState; /* wait state for sync rep */ SHM_QUEUE syncRepLinks; /* list link if process is in syncrep queue */ |