[ovs-dev] [PATCH v5 03/10] util: Add high resolution sleep support.

Bodireddy, Bhanuprakash bhanuprakash.bodireddy at intel.com
Mon Nov 6 17:29:26 UTC 2017


Hi Ben,
>
>On Fri, Sep 15, 2017 at 05:40:23PM +0100, Bhanuprakash Bodireddy wrote:
>> This commit introduces xnanosleep() for the threads needing high
>> resolution sleep timeouts.
>>
>> Signed-off-by: Bhanuprakash Bodireddy
>> <bhanuprakash.bodireddy at intel.com>
>
>This is a little confusing.  The name xnanosleep() implies that its argument
>would be in nanoseconds, but it's in fact in milliseconds.
>Second, I don't understand why it's only implemented for Linux.

I tried reworking this API with nanoseconds argument and implementing nsec_to_timespec() today. 
This changes works fine on Linux, however the windows build breaks with below error as reported by appveyor.

error C4013: 'nanosleep' undefined; assuming extern returning int
(windows.h and time.h headers are included).

But looks like nanosleep is supported on windows. Any inputs on this would be helpful.

- Bhanuprakash.



More information about the dev mailing list