Re: Extended Layout incubator branch.

2010-04-30 Thread Matthias Clasen
On Wed, Apr 28, 2010 at 12:59 AM, Matthias Clasen wrote: > I have now fixed up the docs for GtkContainer and for GtkLabel > width-chars and max-width-chars and fixed the few remaining > regressions that I found. I've merged this now. Let me know if you spot any regressions. __

Re: Unix signals in GLib

2010-04-30 Thread Stef Walter
On 2010-04-30 13:38, Matthew Bucknall wrote: > Find attached an excerpt from an application of mine. Not entirely > self-contained, but you should get a general idea of what is going on. > > Using the attached code, my application calls app_signal_block_unused() > early on during initialization. T

Re: Unix signals in GLib

2010-04-30 Thread Matthew Bucknall
Find attached an excerpt from an application of mine. Not entirely self-contained, but you should get a general idea of what is going on. Using the attached code, my application calls app_signal_block_unused() early on during initialization. The signal listening thread is initialized and started b

Re: Unix signals in GLib

2010-04-30 Thread Xavier Bestel
On Fri, 2010-04-30 at 11:02 -0500, Stef Walter wrote: > 1. Block signals you're interested in on all threads, usually done > early on, before starting any threads. Using pthread_sigmask. How do you block signals in all threads before starting any thread ? Oh well, I guess looking at how you d

Re: Unix signals in GLib

2010-04-30 Thread Stef Walter
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 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. >

Re: Unix signals in GLib

2010-04-30 Thread Stef Walter
On 2010-04-30 08:53, Richard Hughes wrote: > On 30 April 2010 14:36, Stef Walter 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

Re: Unix signals in GLib

2010-04-30 Thread Mathieu Lacage
On Fri, 2010-04-30 at 08:36 -0500, Stef Walter 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. create a thread and sigwait in it in the hope that no other thread does the same.

Re: Unix signals in GLib

2010-04-30 Thread Owen Taylor
On Fri, 2010-04-30 at 09:18 +0100, Richard Hughes wrote: > I'm writing for comments. Making my daemons (upower, PackageKit, etc) > quit nicely after receiving SIGTERM or SIGINT is _really_ hard to do > correctly. The fact that I can only do a few things (write, etc) in > the signal handler makes ot

Re: Unix signals in GLib

2010-04-30 Thread Richard Hughes
On 30 April 2010 14:36, Stef Walter 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. Richard.

Re: Unix signals in GLib

2010-04-30 Thread Stef Walter
On 2010-04-30 03:56, Andy Wingo wrote: > On Fri 30 Apr 2010 10:23, Xavier Bestel writes: > >> On Fri, 2010-04-30 at 09:18 +0100, Richard Hughes wrote: >>> I'm writing for comments. Making my daemons (upower, PackageKit, etc) >>> quit nicely after receiving SIGTERM or SIGINT is _really_ hard to do

Re: Unix signals in GLib

2010-04-30 Thread Freddie Unpenstein
From: "Andy Wingo", Date: 30/04/2010 19:01 > On Fri 30 Apr 2010 10:23, Xavier Bestel ; writes: >> On Fri, 2010-04-30 at 09:18 +0100, Richard Hughes wrote: >>> I'm writing for comments. Making my daemons (upower, PackageKit, etc) >>> quit nicely after receiving SIGTERM or SIGINT is _really_ hard to

Re: Unix signals in GLib

2010-04-30 Thread Andy Wingo
On Fri 30 Apr 2010 10:23, Xavier Bestel writes: > On Fri, 2010-04-30 at 09:18 +0100, Richard Hughes wrote: >> I'm writing for comments. Making my daemons (upower, PackageKit, etc) >> quit nicely after receiving SIGTERM or SIGINT is _really_ hard to do >> correctly. The fact that I can only do a f

Re: Unix signals in GLib

2010-04-30 Thread Xavier Bestel
On Fri, 2010-04-30 at 09:18 +0100, Richard Hughes wrote: > I'm writing for comments. Making my daemons (upower, PackageKit, etc) > quit nicely after receiving SIGTERM or SIGINT is _really_ hard to do > correctly. The fact that I can only do a few things (write, etc) in > the signal handler makes ot

Re: Unix signals in GLib

2010-04-30 Thread Richard Hughes
On 30 April 2010 09:23, Xavier Bestel wrote: > Can't you just signal your mainloop to quit from the signal handler, and > do the heavyweight work from there ? That's what I'm doing right now, but I've been told that's not safe. If it is, then it's much less work for me. Richard.

Unix signals in GLib

2010-04-30 Thread Richard Hughes
I'm writing for comments. Making my daemons (upower, PackageKit, etc) quit nicely after receiving SIGTERM or SIGINT is _really_ hard to do correctly. The fact that I can only do a few things (write, etc) in the signal handler makes otherwise quite nice GLib code very quickly descend into l33t UNIX