[cairo] Review of: [cairo-mutex] Add a poor man's mutex implementation in case of CAIRO_NO_MUTEX

Carl Worth cworth at cworth.org
Mon Apr 23 14:38:56 PDT 2007


On Sun, 22 Apr 2007 13:13:14 -0700 (PDT), wrote:
> diff-tree ce91a176489f4cb8f40c5ec29f23881d1e013a9f (from 97b50e99bfa785d77b4900d3070f22a22827db22)
> Author: Behdad Esfahbod <behdad at behdad.org>
> Date:   Sun Apr 22 16:13:22 2007 -0400
>
>     [cairo-mutex] Add a poor man's mutex implementation in case of CAIRO_NO_MUTEX
>     just for fun.

> +# define CAIRO_MUTEX_INITIALIZE() CAIRO_MUTEX_NOOP
> +# define CAIRO_MUTEX_LOCK(name) do { while (name) ; (name) = 1; } while (0)
> +# define CAIRO_MUTEX_UNLOCK(name) (name) = 0
> +# define CAIRO_MUTEX_NIL_INITIALIZER 0

Now that you've had your fun, can we just remove this code?

It's only going to get compiled in the case of CAIRO_NO_MUTEX, right?

In which case it's pointless to do anything.

And even in spite of that, it's *really* pointless to have something
named "mutex" that doesn't actually implement mutual exclusion.

Yuck.

-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/20070423/4f72b9ef/attachment.pgp


More information about the cairo mailing list