Use a separate spinlock to protect LWLockTranches

Previously we reused the shmem allocator's ShmemLock to also protect
lwlock.c's shared memory structures. Introduce a separate spinlock for
lwlock.c for the sake of modularity. Now that lwlock.c has its own
shared memory struct (LWLockTranches), this is easy to do.

Reviewed-by: Nathan Bossart <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/12e3e0f2c8f7a47902b4c201ac31a12390f75657

Modified Files
--------------
src/backend/storage/ipc/shmem.c   |  8 +++-----
src/backend/storage/lmgr/lwlock.c | 26 +++++++++++++-------------
src/include/storage/shmem.h       |  1 -
3 files changed, 16 insertions(+), 19 deletions(-)

Reply via email to