qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets tim


From: Alex Bligh
Subject: Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers
Date: Tue, 20 Aug 2013 10:29:04 +0100

On 20 Aug 2013, at 08:19, Wenchao Xia wrote:

>  Thanks for the explanation. It seems *timeout is always set
> to -1 before calling GSource's prepare(), so
> "*timeout = qemu_soonest_timeout(*timeout, 10);"
> will always get *timeout = 10, so this call can be saved.

I believe that's incorrect too. glib *currently* calls
the API that way, but there's nothing to say a future
or past glub couldn't call each g_source with the same
timeout pointer, with each g_source adjusting the timeout
downwards. Or (for instance) call it with 0 for a
non-blocking prepare. Therefore the implemented way
is safer (only reducing the timeout).

-- 
Alex Bligh







reply via email to

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