[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] glib-compat.h: add new thread API emulation
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] glib-compat.h: add new thread API emulation on top of pre-2.31 API |
Date: |
Fri, 2 May 2014 11:45:29 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Apr 29, 2014 at 10:02:25AM +0400, Michael Tokarev wrote:
> Thread API changed in glib-2.31 significantly. Before that version,
> conditionals and mutexes were only allocated dynamically, using
> _new()/_free() interface. in 2.31 and up, they're allocated statically
> as regular variables, and old interface is deprecated.
>
> (Note: glib docs says the new interface is available since version
> 2.32, but it was actually introduced in version 2.31).
>
> Create the new interface using old primitives, re-defining the base
> types (GCond and GMutex) to be pointers.
>
> Replace #ifdeffery around GCond and GMutex in trace/simple.c and
> coroutine-gthread.c too because it does not work anymore with the new
> glib-compat.h.
>
> Signed-off-by: Michael Tokarev <address@hidden>
> ---
> coroutine-gthread.c | 30 +++++---------
> include/glib-compat.h | 103
> +++++++++++++++++++++++++++++++++++++++++++++++++
> trace/simple.c | 50 +++++++-----------------
> 3 files changed, 126 insertions(+), 57 deletions(-)
The approach in this patch is more invasive due to the #ifdef of the
pointer types.
I have another approach here:
https://lists.gnu.org/archive/html/qemu-devel/2014-02/msg00236.html
What do you think?
Stefan
- Re: [Qemu-devel] [PATCH 2/5] glib-compat.h: add new thread API emulation on top of pre-2.31 API,
Stefan Hajnoczi <=