From: Stefan Weil <sw@weilnetz.de>
To: Alex Bligh <alex@alex.org.uk>
Cc: qemu-trivial <qemu-trivial@nongnu.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCHv2] aio / timers: use g_usleep() not sleep()
Date: Fri, 30 Aug 2013 06:01:50 +0200 [thread overview]
Message-ID: <5220192E.5040301@weilnetz.de> (raw)
In-Reply-To: <1377815534-13608-1-git-send-email-alex@alex.org.uk>
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 <alex@alex.org.uk>
> ---
> 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 <sw@weilnetz.de>
I cc'ed the mail to qemu-trivial, so it can be applied there.
Stefan
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Weil <sw@weilnetz.de>
To: Alex Bligh <alex@alex.org.uk>
Cc: qemu-trivial <qemu-trivial@nongnu.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCHv2] aio / timers: use g_usleep() not sleep()
Date: Fri, 30 Aug 2013 06:01:50 +0200 [thread overview]
Message-ID: <5220192E.5040301@weilnetz.de> (raw)
In-Reply-To: <1377815534-13608-1-git-send-email-alex@alex.org.uk>
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 <alex@alex.org.uk>
> ---
> 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 <sw@weilnetz.de>
I cc'ed the mail to qemu-trivial, so it can be applied there.
Stefan
next prev parent reply other threads:[~2013-08-30 4:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 22:32 [Qemu-devel] [PATCHv2] aio / timers: use g_usleep() not sleep() Alex Bligh
2013-08-30 4:01 ` Stefan Weil [this message]
2013-08-30 4:01 ` Stefan Weil
2013-09-01 16:03 ` [Qemu-trivial] " Michael Tokarev
2013-09-01 16:03 ` [Qemu-devel] " Michael Tokarev
2013-09-03 9:58 ` [Qemu-devel] " Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5220192E.5040301@weilnetz.de \
--to=sw@weilnetz.de \
--cc=alex@alex.org.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.