Re: Assert(LWLockHeldByMeInMode(lock, LW_EXCLUSIVE))

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert(LWLockHeldByMeInMode(lock, LW_EXCLUSIVE))
Date: 2016-06-20 03:43:35
Message-ID: CAMsr+YGMDaFavkYdYZ9tzSuHC9EUp4p3HjfETukb52jhWyBF7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18 June 2016 at 11:28, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
wrote:

> Hi hackers,
>
> Several times now when reading, debugging and writing code I've wished
> that LWLockHeldByMe assertions specified the expected mode, especially
> where exclusive locking is required.
>
> What do you think about something like the attached? See also an
> example of use. I will add this to the next commitfest.

I've wanted this before too, and was surprised it wasn't present. TBH I
assumed there was a technical reason it wasn't and didn't investigate
further because I just assumed it'd have been added with the original
LWLockHeldByMe if it were simple.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-06-20 04:27:09 Re: Experimental dynamic memory allocation of postgresql shared memory
Previous Message Craig Ringer 2016-06-20 03:40:06 Re: Experimental dynamic memory allocation of postgresql shared memory