[Pixman] Fwd: [PATCH 1/8] Add platform specific mutex implementations
Maarten Bosmans
mkbosmans at gmail.com
Mon Sep 19 12:10:09 PDT 2011
---------- Forwarded message ----------
From: Maarten Bosmans <mkbosmans at gmail.com>
Date: 2011/9/19
Subject: Re: [Pixman] [PATCH 1/8] Add platform specific mutex implementations
To: Taekyun Kim <podain77 at gmail.com>
2011/9/19 Taekyun Kim <podain77 at gmail.com>:
> From: Taekyun Kim <tkq.kim at samsung.com>
>
> Declare mutex with type of pixman_mutex_t and use following macros.
>
> PIXMAN_MUTEX_INIT()
> PIXMAN_MUTEX_LOCK()
> PIXMAN_MUTEX_UNLOCK()
> PIXMAN_MUTEX_FINI()
>
> If any mutex implemenatation is supported by the system, HAVE_MUTEX
> macro will be defined.
> ---
> --- a/pixman/pixman-compiler.h
> +++ b/pixman/pixman-compiler.h
> +#elif defined(_WIN32)
> +
> +# include <windows.h>
> +
> +typedef CRITICAL_SECTION pixman_mutex_t;
> +
> +# define PIXMAN_MUTEX_INIT(mutex) InitializeCriticalSection (&(mutex))
> +# define PIXMAN_MUTEX_LOCK(mutex) EnterCriticalSection (&(mutex))
> +# define PIXMAN_MUTEX_UNLOCK(mutex) LeaveCriticalSection (&(mutex))
> +# define PIXMAN_MUTEX_FINI(mutex) DeleteCriticalSection (&(mutex))
Nice, this is exactly what I had in mind after Andrea's comments.
Maarten
More information about the Pixman
mailing list