Re: Clean up NamedLWLockTranche stuff

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Clean up NamedLWLockTranche stuff
Дата
Msg-id 1e1dd445-730e-40c9-b0f7-4d153bb013fb@iki.fi
обсуждение исходный текст
Ответ на Re: Clean up NamedLWLockTranche stuff  (Sami Imseih <samimseih@gmail.com>)
Ответы Re: Clean up NamedLWLockTranche stuff
Re: Clean up NamedLWLockTranche stuff
Список pgsql-hackers
On 27/03/2026 06:49, Sami Imseih wrote:
>> +/* backend-local copy of NamedLWLockTranches->num_user_defined */
>> +static int  LocalNumUserDefinedTranches;
> 
>> The comment here should reference "LWLockTranches->num_user_defined "
>> instead.
> 
>> Also, there are a few places in lwlock.c where "named tranches" is mentioned.
>> Maybe we should just say "user-defined tranches" instead?
> 
> Like the attached.

> @@ -460,7 +460,7 @@ LWLockShmemInit(void)
>  }
>  
>  /*
> - * Initialize LWLocks that are fixed and those belonging to named tranches.
> + * Initialize LWLocks that are fixed and those belonging to user-defined tranches.
>   */
>  static void
>  InitializeLWLocks(int numLocks)

Only tranches requested with RequestNamedLWLockTranche() have locks in 
the main array, so I reworded this some more to:

  /*
   * Initialize LWLocks for built-in tranches and those requested with
   * RequestNamedLWLockTranche().
   */

Committed with that little change, thanks!

- Heikki




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