Skip to content

Commit 6c0c49f

Browse files
committed
Remove unused latch
It was left unused by commit bc971f4, which replaced the latch usage with a condition variable Discussion: https://www.postgresql.org/message-id/391abe21-413e-4d91-a650-b663af49500c@iki.fi
1 parent adbb27a commit 6c0c49f

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/backend/replication/walsender.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,6 @@ InitWalSenderSlot(void)
29352935
walsnd->flushLag = -1;
29362936
walsnd->applyLag = -1;
29372937
walsnd->sync_standby_priority = 0;
2938-
walsnd->latch = &MyProc->procLatch;
29392938
walsnd->replyTime = 0;
29402939

29412940
/*
@@ -2979,8 +2978,6 @@ WalSndKill(int code, Datum arg)
29792978
MyWalSnd = NULL;
29802979

29812980
SpinLockAcquire(&walsnd->mutex);
2982-
/* clear latch while holding the spinlock, so it can safely be read */
2983-
walsnd->latch = NULL;
29842981
/* Mark WalSnd struct as no longer being in use. */
29852982
walsnd->pid = 0;
29862983
SpinLockRelease(&walsnd->mutex);

src/include/replication/walsender_private.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "nodes/replnodes.h"
1919
#include "replication/syncrep.h"
2020
#include "storage/condition_variable.h"
21-
#include "storage/latch.h"
2221
#include "storage/shmem.h"
2322
#include "storage/spin.h"
2423

@@ -71,12 +70,6 @@ typedef struct WalSnd
7170
/* Protects shared variables in this structure. */
7271
slock_t mutex;
7372

74-
/*
75-
* Pointer to the walsender's latch. Used by backends to wake up this
76-
* walsender when it has work to do. NULL if the walsender isn't active.
77-
*/
78-
Latch *latch;
79-
8073
/*
8174
* Timestamp of the last message received from standby.
8275
*/

0 commit comments

Comments
 (0)