Re: gerror.c revisited



Hi Owen,

> In my understanding:
> 
>  - if GQuark is not written atomically, you need a lock on
>    the outside, around the read.
> 
>  - If GQuark is written atomically (a safe assumption), then
>    no locking is necessary, since not only do quarks represent
>    themself, but g_quark_from[_static]_string is idempotent.
>    It does no harm to call it multiple times. So, the obvious
>    implementation

Yes, that's of course true....... How come, I didn't take notice....

> > An alternative is to make a function in gthread.c instead of the extern
> > variables in glib.h above:
> >
> > GQuark
> > g_thread_error_quark
> > {
> >   GQuark quark;
> >   return quark ? quark : g_quark_from_static_string_once (&quark,
> >                                                          "gthread-error");
> > }
> >
> > That would help keeping the variable name space of glib sparse.
> 
> I don't see any advantage in this, considering my comments about
> threads above.

Yes, you're right..... I wonder, when I'll something right the first time :-(

Bye,
Sebastian
-- 
Sebastian Wilhelmi                   |            här ovanför alla molnen
mailto:wilhelmi@ira.uka.de           |     är himmlen så förunderligt blå
http://goethe.ira.uka.de/~wilhelmi   |





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