From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsuC5-0004IY-1x for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:28:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsuBz-0002pp-BH for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:28:28 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:34379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsuBz-0002pI-4a for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:28:23 -0400 Received: by mail-wg0-f52.google.com with SMTP id l18so2756898wgh.11 for ; Fri, 06 Jun 2014 06:28:22 -0700 (PDT) Date: Fri, 6 Jun 2014 15:28:19 +0200 From: Stefan Hajnoczi Message-ID: <20140606132819.GK14322@stefanha-thinkpad> References: <1400845497-29618-1-git-send-email-pbonzini@redhat.com> <1400845497-29618-2-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1400845497-29618-2-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/4] glib-compat.h: add new thread API emulation on top of pre-2.31 API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Michael Tokarev , qemu-devel@nongnu.org, stefanha@redhat.com, mjt@mls.msk.ru On Fri, May 23, 2014 at 01:44:54PM +0200, Paolo Bonzini wrote: > From: Michael Tokarev > > 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, by providing non-opaque > definitions of the base types (GCond and GMutex) using GOnces. > > 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 > Reviewed-by: Alon Levy > Tested-by: Alon Levy > [Use GOnce to support lazy initialization; introduce CompatGMutex > and CompatGCond. - Paolo] > Signed-off-by: Paolo Bonzini > --- > coroutine-gthread.c | 29 +++--------- > include/glib-compat.h | 119 +++++++++++++++++++++++++++++++++++++++++++++++++ > trace/simple.c | 50 +++++---------------- > 3 files changed, 138 insertions(+), 60 deletions(-) You clever devil :-) Reviewed-by: Stefan Hajnoczi