Re: Adding custom GDK events



Am Freitag, den 12.01.2007, 11:25 +0100 schrieb Murray Cumming:
> On Fri, 2007-01-12 at 03:03 +0100, Daniel Elstner wrote:
> > 
> > Now wait... are you really sure Glib::signal_idle() is thread-safe? 
> 
> It's meant to be in glib, at least.

Yes, most of GLib is thread-safe if used with some precautions.  The
problem is that we do not just pass a function pointer to it, but also
an allocated data structure written to in one thread and read in
another.  The main problem is that sigc++ uses reference counting
instead of copy semantics.

BTW that's also the reason I didn't inherit from sigc::trackable in the
Dispatcher code and thread examples.  I see that you changed that.  It
might not be an issue at all but it'll need investigating how exactly
the objects are used in these instances.  Avoiding all the implicit
behind-the-scenes stuff made sure that it isn't a problem, though.

--Daniel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]