Re: Plugins redux (was Re: [PATCHES] PL instrumentation

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Plugins redux (was Re: [PATCHES] PL instrumentation
Дата
Msg-id 1155147458.12968.147.camel@dogma.v10.wvs
обсуждение исходный текст
Ответ на Plugins redux (was Re: [PATCHES] PL instrumentation plugin support)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Plugins redux (was Re: [PATCHES] PL instrumentation plugin support)
Список pgsql-hackers
On Wed, 2006-08-09 at 12:44 -0400, Tom Lane wrote:
> A plugin such as a plpgsql debugger would do this in its _PG_init()
> function:
> 
>     static PLpgSQL_plugin my_plugin = { ... function addresses ... };
> 
>     PLpgSQL_plugin **var_ptr;
> 
>     var_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin");
>     *var_ptr = &my_plugin;
> 
> and this in its _PG_fini() function:
> 
>     PLpgSQL_plugin **var_ptr;
> 
>     var_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin");
>     *var_ptr = NULL;
> 
> Meanwhile, plpgsql itself would do this in its _PG_init() function:
> 
>     static PLpgSQL_plugin **plugin_ptr = NULL;
> 
>     plugin_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin");
> 
> and in the places where it wants to pass control to the plugin, it'd do
> 
>     if (*plugin_ptr)
>         ((*plugin_ptr)->function_field) (... args ...);
> 

I know this is a trivial question, but is there some kind of lock that
would prevent the PG_fini for the plpgsql debugger from executing after
"if(*plugin_ptr)" and before "((*plugin_ptr)->function_field)(...)"?

Regards,Jeff Davis



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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: 8.2 features status
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Plugins redux (was Re: [PATCHES] PL instrumentation plugin support)