From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyf4w-0002ZU-N4 for qemu-devel@nongnu.org; Mon, 15 Jul 2013 05:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyf4v-0004y8-62 for qemu-devel@nongnu.org; Mon, 15 Jul 2013 05:28:22 -0400 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:65170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyf4u-0004xv-Vg for qemu-devel@nongnu.org; Mon, 15 Jul 2013 05:28:21 -0400 Received: by mail-wg0-f49.google.com with SMTP id a12so9780636wgh.4 for ; Mon, 15 Jul 2013 02:28:20 -0700 (PDT) Date: Mon, 15 Jul 2013 17:28:09 +0800 From: Stefan Hajnoczi Message-ID: <20130715092809.GA15043@stefanha-thinkpad.redhat.com> References: <1373191217-3204-1-git-send-email-pingfank@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1373191217-3204-1-git-send-email-pingfank@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v5] QEMUBH: make AioContext's bh re-entrant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi On Sun, Jul 07, 2013 at 06:00:17PM +0800, Liu Ping Fan wrote: > @@ -211,6 +238,7 @@ AioContext *aio_context_new(void) > ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext)); > ctx->pollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD)); > ctx->thread_pool = NULL; > + qemu_mutex_init(&ctx->bh_lock); > event_notifier_init(&ctx->notifier, false); > aio_set_event_notifier(ctx, &ctx->notifier, > (EventNotifierHandler *) The mutex should be destroyed in aio_ctx_finalize().