Advice needed concerning Win32 signals

Поиск
Список
Период
Сортировка
От Thomas Hallgren
Тема Advice needed concerning Win32 signals
Дата
Msg-id 43527068.5000107@home.se
обсуждение исходный текст
Список pgsql-hackers
Hi,
I'm in the process of securing the PL/Java signal handling routines. 
Since a multi-threaded JVM is running and a signal can occur at any time 
in any thread, I need to trap some of them and make sure that they are 
executed in the main thread. Using Posix signals, this is easy. Here's a 
sample handler:

static void pljavaStatementCancelHandler(int signum)
{   if(pthread_self() == mainThread)      /*       * Call original handler       */
StatementCancelHandler(signum);  else      /*       * Dispatch to main thread.       */       pthread_kill(mainThread,
signum);/* Send it to main thread */
 
}

The mainThread was initialized when the handler was first registered.
From looking at the PostgreSQL signal handling routines for Win32, I 
realize that several threads are involved already. Perhaps all signals 
are indeed dispatched to the main thread already? I couldn't really 
figure it out. I need help from someone who knows more about this.

Regards,
Thomas Hallgren



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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Question about Ctrl-C and less
Следующее
От: Greg Stark
Дата:
Сообщение: Re: slow IN() clause for many cases