qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 04/17] tests: adjust test-thread-pool to new


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v4 04/17] tests: adjust test-thread-pool to new aio_poll() semantics
Date: Thu, 27 Jun 2013 15:16:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]