diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-09 15:30:51 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-09 15:30:51 -0400 |
commit | 6760a4d4029121981bf3ec24847ddfbacecc070d (patch) | |
tree | feb33208524b430e32fefd2c11158235ba1306a6 /src/backend/storage/lmgr/proc.c | |
parent | 028a0c5a2913f18c954845cc014786912f39fa30 (diff) |
Documentation improvement and minor code cleanups for the latch facility.
Improve the documentation around weak-memory-ordering risks, and do a pass
of general editorialization on the comments in the latch code. Make the
Windows latch code more like the Unix latch code where feasible; in
particular provide the same Assert checks in both implementations.
Fix poorly-placed WaitLatch call in syncrep.c.
This patch resolves, for the moment, concerns around weak-memory-ordering
bugs in latch-related code: we have documented the restrictions and checked
that existing calls meet them. In 9.2 I hope that we will install suitable
memory barrier instructions in SetLatch/ResetLatch, so that their callers
don't need to be quite so careful.
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 7da4337a156..9ef008e7331 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -338,7 +338,7 @@ InitProcess(void) MyProc->waitLSN.xrecoff = 0; MyProc->syncRepState = SYNC_REP_NOT_WAITING; SHMQueueElemInit(&(MyProc->syncRepLinks)); - OwnLatch((Latch *) &MyProc->waitLatch); + OwnLatch(&MyProc->waitLatch); /* * We might be reusing a semaphore that belonged to a failed process. So |