Re: Refactoring lock.c

Lists: pgsql-patches
From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-patches(at)postgresql(dot)org
Subject: Refactoring lock.c
Date: 2005-02-02 19:41:15
Message-ID: Pine.OSF.4.61.0502022057370.463931@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi,

There's two almost identical pieces of code in LockRelease and
LockReleaseAll that do the opposite of GrantLock.

Here's a small patch that replaces those pieces with a static UnGrantLock
function.

This is preparation for the two-phase commit patch, since that introduces
more calls to UnGrantLock.

- Heikki

Attachment Content-Type Size
UnGrantLock.patch text/plain 5.4 KB

From: Neil Conway <neilc(at)samurai(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Refactoring lock.c
Date: 2005-02-03 00:00:08
Message-ID: 1107388808.26960.31.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Wed, 2005-02-02 at 21:41 +0200, Heikki Linnakangas wrote:
> There's two almost identical pieces of code in LockRelease and
> LockReleaseAll that do the opposite of GrantLock.
>
> Here's a small patch that replaces those pieces with a static UnGrantLock
> function.

LockReleaseAll() did not update the holdMask bits for a released
proclock, but it will do so now. That's okay because we're removing the
proclock, right?

Barring any objections, I'll apply this to HEAD today or tomorrow.

-Neil


From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Refactoring lock.c
Date: 2005-02-03 15:34:28
Message-ID: Pine.OSF.4.61.0502031734040.127773@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Thu, 3 Feb 2005, Neil Conway wrote:

> On Wed, 2005-02-02 at 21:41 +0200, Heikki Linnakangas wrote:
>> There's two almost identical pieces of code in LockRelease and
>> LockReleaseAll that do the opposite of GrantLock.
>>
>> Here's a small patch that replaces those pieces with a static UnGrantLock
>> function.
>
> LockReleaseAll() did not update the holdMask bits for a released
> proclock, but it will do so now. That's okay because we're removing the
> proclock, right?

Right.

- Heikki


From: Neil Conway <neilc(at)samurai(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Refactoring lock.c
Date: 2005-02-04 02:06:06
Message-ID: 4202D88E.4060906@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Heikki Linnakangas wrote:
> There's two almost identical pieces of code in LockRelease and
> LockReleaseAll that do the opposite of GrantLock.
>
> Here's a small patch that replaces those pieces with a static
> UnGrantLock function.

Applied to HEAD with a few trivial editorial fixes.

Thanks for the patch.

-Neil