[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv2] aio / timers: use g_usleep() not sleep()
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [PATCHv2] aio / timers: use g_usleep() not sleep() |
Date: |
Fri, 30 Aug 2013 06:01:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 |
Am 30.08.2013 00:32, schrieb Alex Bligh:
> sleep() apparently doesn't exist under mingw. Use g_usleep for
> portability.
>
> Signed-off-by: Alex Bligh <address@hidden>
> ---
> tests/test-aio.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/test-aio.c b/tests/test-aio.c
> index 4215701..c4fe0fc 100644
> --- a/tests/test-aio.c
> +++ b/tests/test-aio.c
> @@ -400,7 +400,7 @@ static void test_timer_schedule(void)
> g_assert(!aio_poll(ctx, false));
> g_assert_cmpint(data.n, ==, 0);
>
> - sleep(1);
> + g_usleep(1 * G_USEC_PER_SEC);
> g_assert_cmpint(data.n, ==, 0);
>
> g_assert(aio_poll(ctx, false));
> @@ -736,7 +736,7 @@ static void test_source_timer_schedule(void)
>
> g_assert_cmpint(data.n, ==, 0);
>
> - sleep(1);
> + g_usleep(1 * G_USEC_PER_SEC);
> g_assert_cmpint(data.n, ==, 0);
>
> g_assert(g_main_context_iteration(NULL, false));
> @@ -746,7 +746,7 @@ static void test_source_timer_schedule(void)
> do {
> g_assert(g_main_context_iteration(NULL, true));
> } while (qemu_clock_get_ns(data.clock_type) <= expiry);
> - sleep(1);
> + g_usleep(1 * G_USEC_PER_SEC);
> g_main_context_iteration(NULL, false);
>
> g_assert_cmpint(data.n, ==, 2);
Reviewed-by: Stefan Weil <address@hidden>
I cc'ed the mail to qemu-trivial, so it can be applied there.
Stefan