Re: Confusing variable naming in LWLockRelease

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Confusing variable naming in LWLockRelease
Дата
Msg-id 256baafad960f39f56149d4c52be29820d1cf76d.camel@j-davis.com
обсуждение исходный текст
Ответы Re: Confusing variable naming in LWLockRelease
Список pgsql-hackers
On Wed, 2025-01-29 at 23:16 -0800, Jacob Brazeal wrote:
> Here the variable name "oldstate" leads one to believe that the value
> is fetched before the sub operation, similar to some other usages in
> lwlock.c.

I believe it refers to the state of the lock prior to lock acquisition;
not prior to subtraction.

I agree that it's a bit confusing, because I don't think it necessarily
changes it back to the state prior to acquisition if it's a shared
lock. But the name "newstate" wouldn't be great, either.

I don't have a great name in mind, so perhaps a comment instead?

Regards,
    Jeff Davis




В списке pgsql-hackers по дате отправления: