Re: Event loop hangup when using TimeoutSource and IdleSource
- From: Jim Hodapp <james hodapp gmail com>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: gtkmm-list gnome org
- Subject: Re: Event loop hangup when using TimeoutSource and IdleSource
- Date: Thu, 24 Sep 2009 16:28:58 -0400
That's a good tip, I am inheriting from sigc::trackable for the Emsac
class. This might be part of the problem. If I don't inherit from
sigc::trackable, what's the proper way of cleaning up the functor slot?
Thanks,
Jim
On Sep 24, 2009, at 4:25 PM, Chris Vine wrote:
On Thu, 24 Sep 2009 21:21:26 +0100
Chris Vine <chris cvine freeserve co uk> wrote:
It may well not be related to your specific problem and I am not
clear what in your code is doing what in what thread, but nonetheless
you cannot call Glib::signal_idle().connect() from a worker thread as
it is not thread safe. If you want to post idle handlers from other
than the GUI thread, then you will have to use g_idle_add_full()
directly, which is thread safe, but you may be better off with
Glib::Notifier.
Perhaps I also ought to add that if, in the light of this, you are
thinking of using g_idle_add_full() and are thinking of passing a slot
as the data argument of that function, make sure it represents
either a
static method, or a non-static method of a class not deriving from
sigc::trackable, as sigc::trackable is not thread safe.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]