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 <pbonz...@redhat.com>