Re: Add assertion on held AddinShmemInitLock in GetNamedLWLockTranche()

2023-08-10 Thread Michael Paquier
On Fri, Jul 28, 2023 at 11:07:49AM +0530, Bharath Rupireddy wrote: > Why to block multiple readers (if at all there exists any), with > LWLockHeldByMeInMode(..., LW_EXCLUSIVE)? I think > Assert(LWLockHeldByMe(AddinShmemInitLock)); suffices in > GetNamedLWLockTranche. I am not sure to follow this a

Re: Add assertion on held AddinShmemInitLock in GetNamedLWLockTranche()

2023-07-27 Thread Bharath Rupireddy
On Fri, Jul 28, 2023 at 8:54 AM Michael Paquier wrote: > > Hi all, > > While digging into the LWLock code, I have noticed that > GetNamedLWLockTranche() assumes that its caller should hold the LWLock > AddinShmemInitLock to prevent any kind of race conditions when > initializing shmem areas, but w

Add assertion on held AddinShmemInitLock in GetNamedLWLockTranche()

2023-07-27 Thread Michael Paquier
Hi all, While digging into the LWLock code, I have noticed that GetNamedLWLockTranche() assumes that its caller should hold the LWLock AddinShmemInitLock to prevent any kind of race conditions when initializing shmem areas, but we don't make sure that's the case. The sole caller of GetNamedLWLock