RE : Apparent thread-safety bug in Glib 2.0 docs
- From: "Joaquin Cuenca Abela" <e98cuenc free fr>
- To: "'Sebastian Wilhelmi'" <seppi seppi de>, "'Christopher Smith'" <x xman org>
- Cc: "'gtk-devel'" <gtk-devel-list gnome org>
- Subject: RE : Apparent thread-safety bug in Glib 2.0 docs
- Date: Sat, 25 Oct 2003 23:32:55 +0200
Sebastion wrote:
>
> Hi Christopher,
>
> >
> http://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html#id294168
> > 2
> >
> > It lists 4 examples while talking about thread-safe code.
> > Unfortunately, the 3rd & 4th examples, though labeled as
> thread safe
> > appear to not be thread safe.
> >
> > The problem that I'm perceiving is that the
> "current_number" variable
> > is not declared as volatile. While this might seem nit
> picky, without
> > this flag the compiler may very well generate incorrect code. Given
> > that this is a common programmer error, I think it'd be a
> good idea to
> > either elaborate this point in the documentation, or at
> least correct
> > the examples. Thoughts?
>
> You are right. This is an oversight. I'll propose adding the
Hi all,
Can you please elaborate a bit more how is a compiler suppossed to
generate incorrect code in examples 3 & 4?
They look perfectly fine to me.
Cheers,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]