[cairo] Bug in cairo-mutex.c

Hans-Jürgen Schäler hjschaeler at t-online.de
Thu Apr 19 00:11:01 PDT 2007


I have found a bug in cairo-mutex.c.
The bug occures when HAVE_PTHREAD_H is not set.
(This is the case if you create a version of cairo with MSC.)

1. The list of mutexes that must be initialized is not set because
   the #define CAIRO_MUTEX_LIST_PRIVATE_H prevents the 2nd read of

2. In the case of MSC CAIRO_MUTEX_INIT() needs the adress of the mutex
   instead of the mutex itself.
   (Im am not sure if this is right in all cases.)

3. _cairo_mutex_initialized is not set to TRUE after initializing all
   Consequence: It can happen that a mutex is initialized after setting the

Also some #defines ar missing in cairo-wideint-private.h for MSC.
(See the attached patch: cairo-070419.dif).

Best regards

Hans-Jürgen Schäler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-mutex.c
Type: text/x-csrc
Size: 1922 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070419/e77d0258/cairo-mutex.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-070419.dif
Type: video/dv
Size: 466 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070419/e77d0258/cairo-070419.bin

More information about the cairo mailing list