Received: from eggs.gnu.org ([2001:4830:134:3::10]:34713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgA2G-0000jf-UQ for qemu-devel@nongnu.org; Fri, 02 May 2014 05:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgA2A-0000RZ-Dh for qemu-devel@nongnu.org; Fri, 02 May 2014 05:45:40 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:40318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgA2A-0000RH-00 for qemu-devel@nongnu.org; Fri, 02 May 2014 05:45:34 -0400 Received: by mail-wi0-f180.google.com with SMTP id hi5so1113551wib.13 for ; Fri, 02 May 2014 02:45:33 -0700 (PDT) Date: Fri, 2 May 2014 11:45:29 +0200 From: Stefan Hajnoczi Message-ID: <20140502094529.GI8005@stefanha-thinkpad.redhat.com> References: <1398751349-20869-1-git-send-email-mjt@msgid.tls.msk.ru> <1398751349-20869-3-git-send-email-mjt@msgid.tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1398751349-20869-3-git-send-email-mjt@msgid.tls.msk.ru> Subject: Re: [Qemu-devel] [PATCH 2/5] 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: Michael Tokarev Cc: Benoit Canet , qemu-devel@nongnu.org, Christophe Fergeau , Alon Levy , Stefan Hajnoczi , Paolo Bonzini 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 > --- > 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