All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Benoit Canet <benoit@irqsave.net>,
	qemu-devel@nongnu.org, Christophe Fergeau <cfergeau@redhat.com>,
	Alon Levy <alevy@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
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	[thread overview]
Message-ID: <20140502094529.GI8005@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1398751349-20869-3-git-send-email-mjt@msgid.tls.msk.ru>

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 <mjt@tls.msk.ru>
> ---
>  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

  parent reply	other threads:[~2014-05-02  9:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1398751349-20869-1-git-send-email-mjt@msgid.tls.msk.ru>
     [not found] ` <1398751349-20869-2-git-send-email-mjt@msgid.tls.msk.ru>
2014-05-02  9:41   ` [Qemu-devel] [PATCH 1/5] do not call g_thread_init() for glib >= 2.31 Stefan Hajnoczi
     [not found] ` <1398751349-20869-3-git-send-email-mjt@msgid.tls.msk.ru>
2014-05-02  9:45   ` Stefan Hajnoczi [this message]
2014-05-02 12:11     ` [Qemu-devel] [PATCH 2/5] glib-compat.h: add new thread API emulation on top of pre-2.31 API Michael Tokarev
2014-05-05 14:49 ` [Qemu-devel] [PATCH 0/5] glib thread interface and libcacard cleanups Alon Levy
2014-05-05 16:36   ` Michael Tokarev
2014-05-06  9:22     ` Alon Levy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140502094529.GI8005@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=alevy@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=cfergeau@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.