Re: Event loop hangup when using TimeoutSource and IdleSource



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]