Re: Unix signals in GLib
- From: Stef Walter <stef-list memberwebs com>
- Cc: Andy Wingo <wingo pobox com>, Gtk+ Developers <gtk-devel-list gnome org>, Xavier Bestel <xavier bestel free fr>
- Subject: Re: Unix signals in GLib
- Date: Fri, 30 Apr 2010 11:02:21 -0500
On 2010-04-30 10:51, Stef Walter wrote:
> On 2010-04-30 08:53, Richard Hughes wrote:
>> On 30 April 2010 14:36, Stef Walter <stef-list memberwebs com> wrote:
>>> Remember that this doesn't work correctly in threaded apps, as we found
>>> in gnome-keyring-daemon. You have to do the strange
>>> signal-handling-thread-thing.
>>
>> Could you give more details please? Thanks.
>
> For reasons that are almost, but not entirely, clear to me you have to:
Err, wait, that was slightly wrong... You need to:
1. Block signals you're interested in on all threads, usually done
early on, before starting any threads. Using pthread_sigmask.
2. Create a new thread, and call sigwait in that thread on the
interested signals, in a loop, handling signals as they come in.
> Code here:
>
> http://git.gnome.org/browse/gnome-keyring/tree/daemon/gkd-main.c#n285
Cheers,
Stef
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]