Skip to content

Commit 6057f61

Browse files
committed
Small improvements in comments in async.c.
We seem to have lost a line somewhere along the way in the comment block that discusses async.c's locks, because it suddenly refers to "both locks" without previously having mentioned more than one. Add a sentence to make that read more sanely. Also, refer to the "pos of the slowest backend" not the "tail of the slowest backend", since we have no per-backend value called "tail".
1 parent a16db3a commit 6057f61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/commands/async.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ typedef struct QueueBackendStatus
224224
* When holding the lock in EXCLUSIVE mode, backends can inspect the entries
225225
* of other backends and also change the head and tail pointers.
226226
*
227+
* AsyncCtlLock is used as the control lock for the pg_notify SLRU buffers.
227228
* In order to avoid deadlocks, whenever we need both locks, we always first
228229
* get AsyncQueueLock and then AsyncCtlLock.
229230
*
@@ -234,7 +235,7 @@ typedef struct QueueBackendStatus
234235
typedef struct AsyncQueueControl
235236
{
236237
QueuePosition head; /* head points to the next free location */
237-
QueuePosition tail; /* the global tail is equivalent to the tail
238+
QueuePosition tail; /* the global tail is equivalent to the pos
238239
* of the "slowest" backend */
239240
TimestampTz lastQueueFillWarn; /* time of last queue-full msg */
240241
QueueBackendStatus backend[FLEXIBLE_ARRAY_MEMBER];

0 commit comments

Comments
 (0)