Обсуждение: Refactoring lock.c

Поиск
Список
Период
Сортировка

Refactoring lock.c

От
Heikki Linnakangas
Дата:
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

Вложения

Re: Refactoring lock.c

От
Neil Conway
Дата:
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



Re: Refactoring lock.c

От
Heikki Linnakangas
Дата:
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

Re: Refactoring lock.c

От
Neil Conway
Дата:
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