[cairo] New per-scaled_font mutex to fix locking bugs

Carl Worth cworth at cworth.org
Tue Feb 6 17:50:19 PST 2007


On Wed, 07 Feb 2007 02:11:05 +0100 (CET), "Peter Weilbacher (Mozilla)" wrote:
> Thanks for the hint. For OS/2 I used these lines to get it to compile:

And thanks for the reply.

>    typedef HMTX cairo_mutex_t;
>    # define CAIRO_MUTEX_INIT(mutex) DosCreateMutexSem (NULL, mutex, 0L, TRUE)
>    # define CAIRO_MUTEX_FINI(mutex) DosCloseMutexSem (*(mutex))
>    # define CAIRO_MUTEX_NIL_INITIALIZER { 0 }

OK. I can throw those in before the final push.

> The empty brackets in the NIL_INITIALIZER caused a compile error with the
> GCC we use on OS/2. I still get this warning
>
>    cairo-scaled-font.c:90: warning: braces around scalar initializer
>    cairo-scaled-font.c:90: warning: (near initialization for `_cairo_scaled_font_nil.mutex')

Oh, so perhaps a bare 0 will do the trick?

    # define CAIRO_MUTEX_NIL_INITIALIZER { 0 }

> Not sure if I should care... I ran a test with fonts, checked that it
> called the two functions involved and that it still worked without
> problems, so I guess this is OK.

The warning really doesn't matter. I promise that cairo won't ever
look at this value, (or if it does, then something else is more broken
than this value).

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070206/aacee024/attachment.pgp


More information about the cairo mailing list