Re: Thread safety with Glib function get_dispatch()



On Sun, 19 Oct 2014 10:01:58 -0400
Ryan H <amishibly gmail com> wrote:
Might be a silly question, but had to ask- with the presence of a
static variable within get_dispatch(), is it really thread safe? Or
is there some other protection in place that I missed?

As far as I recall the GPrivate stuff is thread local.  In addition, the
glib main loop is stated to be thread safe in the documentation.  If
you have doubts, and scepticism is a good attribute for a programmer,
look at the source for the implementation of GPrivate (you must have
begun looking at the source in a limited way already to find the
get_dispatch() function, which is not exported).

Chris



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