aio-win32: reorganize polling loop
commit6493c975af75be5b8d9ade954239bdf5492b7911
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Jul 2015 14:07:50 +0000 (21 16:07 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 22 Jul 2015 11:41:40 +0000 (22 12:41 +0100)
tree6e35d5d9140c7cae03f04d5f91750115b51859e9
parent12d69ac03b45156356b240424623719f15d8143e
aio-win32: reorganize polling loop

Preparatory bugfixes and tweaks to the loop before the next patch:

- disable dispatch optimization during aio_prepare.  This fixes a bug.

- do not modify "blocking" until after the first WaitForMultipleObjects
call.  This is needed in the next patch.

- change the loop to do...while.  This makes it obvious that the loop
is always entered at least once.  In the next patch this is important
because the first iteration undoes the ctx->notify_me increment that
happened before entering the loop.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Message-id: 1437487673-23740-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
aio-win32.c