From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsC7Z-0006pb-7C for qemu-devel@nongnu.org; Thu, 27 Jun 2013 09:20:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsC7Y-0006n1-58 for qemu-devel@nongnu.org; Thu, 27 Jun 2013 09:20:21 -0400 Received: from mail-bk0-x236.google.com ([2a00:1450:4008:c01::236]:57925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsC4L-0005oH-2w for qemu-devel@nongnu.org; Thu, 27 Jun 2013 09:17:01 -0400 Received: by mail-bk0-f54.google.com with SMTP id it16so301918bkc.13 for ; Thu, 27 Jun 2013 06:17:00 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51CC3B46.8090609@redhat.com> Date: Thu, 27 Jun 2013 15:16:54 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1371210243-6099-1-git-send-email-stefanha@redhat.com> <1371210243-6099-5-git-send-email-stefanha@redhat.com> In-Reply-To: <1371210243-6099-5-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 04/17] tests: adjust test-thread-pool to new aio_poll() semantics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , Ping Fan Liu , qemu-devel@nongnu.org Il 14/06/2013 13:43, Stefan Hajnoczi ha scritto: > > -/* Wait until all aio and bh activity has finished */ > -static void qemu_aio_wait_all(void) > -{ > - while (aio_poll(ctx, true)) { > - /* Do nothing */ > - } > -} > - > static void test_submit(void) > { > WorkerTestData data = { .n = 0 }; > thread_pool_submit(pool, worker_cb, &data); > - qemu_aio_wait_all(); > + while (data.n == 0) { > + aio_poll(ctx, true); > + } > g_assert_cmpint(data.n, ==, 1); These will now loop forever for a bad thread_pool_submit that just returns immediately. Slightly worse for debuggability, but thread-pool.c is not expected to have big churn. Reviewed-by: Paolo Bonzini