8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.161 2005/07/31 17:19:19 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.162 2005/08/08 03:11:55 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -144,7 +144,7 @@ InitProcGlobal(void)
144
144
ShmemInitStruct ("Proc Header" ,sizeof (PROC_HDR ),& foundProcGlobal );
145
145
146
146
/*
147
- * Create or attach to the PGPROC structures for dummy (checkpoint )
147
+ * Create or attach to the PGPROC structures for dummy (bgwriter )
148
148
* processes, too.These do not get linked into the freeProcs list.
149
149
*/
150
150
DummyProcs = (PGPROC * )
@@ -289,9 +289,10 @@ InitProcess(void)
289
289
/*
290
290
* InitDummyProcess -- create a dummy per-process data structure
291
291
*
292
- * This is called by checkpoint processes so that they will have a MyProc
293
- * value that's real enough to let them wait for LWLocks. The PGPROC and
294
- * sema that are assigned are the extra ones created during InitProcGlobal.
292
+ * This is called by bgwriter and similar processes so that they will have a
293
+ * MyProc value that's real enough to let them wait for LWLocks. The PGPROC
294
+ * and sema that are assigned are the extra ones created during
295
+ * InitProcGlobal.
295
296
*
296
297
* Dummy processes are presently not expected to wait for real (lockmgr)
297
298
* locks, nor to participate in sinval messaging.
@@ -485,27 +486,12 @@ ProcKill(int code, Datum arg)
485
486
486
487
Assert (MyProc != NULL );
487
488
488
- /* Release any LW locks I am holding */
489
- LWLockReleaseAll ();
490
-
491
489
/*
492
- * Make real sure we release any buffer locks and pins we might be
493
- * holding, too. It is pretty ugly to do this here and not in a
494
- * shutdown callback registered by the bufmgr ... but we must do this
495
- * *after* LWLockReleaseAll and *before* zapping MyProc.
490
+ * Release any LW locks I am holding. There really shouldn't be any,
491
+ * but it's cheap to check again before we cut the knees off the LWLock
492
+ * facility by releasing our PGPROC ...
496
493
*/
497
- AtProcExit_Buffers ();
498
-
499
- /* Get off any wait queue I might be on */
500
- LockWaitCancel ();
501
-
502
- /* Remove from the standard lock table */
503
- LockReleaseAll (DEFAULT_LOCKMETHOD , true);
504
-
505
- #ifdef USER_LOCKS
506
- /* Remove from the user lock table */
507
- LockReleaseAll (USER_LOCKMETHOD , true);
508
- #endif
494
+ LWLockReleaseAll ();
509
495
510
496
/* Remove our PGPROC from the PGPROC array in shared memory */
511
497
ProcArrayRemove (MyProc );
@@ -523,7 +509,7 @@ ProcKill(int code, Datum arg)
523
509
}
524
510
525
511
/*
526
- * DummyProcKill() -- Cut-down version of ProcKill for dummy (checkpoint )
512
+ * DummyProcKill() -- Cut-down version of ProcKill for dummy (bgwriter )
527
513
*processes.The PGPROC and sema are not released, only marked
528
514
*as not-in-use.
529
515
*/
@@ -539,14 +525,9 @@ DummyProcKill(int code, Datum arg)
539
525
540
526
Assert (MyProc == dummyproc );
541
527
542
- /* Release any LW locks I am holding */
528
+ /* Release any LW locks I am holding(see notes above) */
543
529
LWLockReleaseAll ();
544
530
545
- /* Release buffer locks and pins, too */
546
- AtProcExit_Buffers ();
547
-
548
- /* I can't be on regular lock queues, so needn't check */
549
-
550
531
/* Mark dummy proc no longer in use */
551
532
MyProc -> pid = 0 ;
552
533