Thanks a lot for the patch.

I have a few comments inlined.

> -----Original Message-----
> From: [email protected] [mailto:ovs-dev-
> [email protected]] On Behalf Of Bhanuprakash Bodireddy
> Sent: Wednesday, November 8, 2017 6:36 PM
> To: [email protected]
> Cc: Alin Gabriel Serdean <[email protected]>
> Subject: [ovs-dev] [PATCH 3/7] util: High resolution sleep support for
> windows.
> 
> This commit implements xnanosleep() for the threads needing high
> resolution sleep timeouts in windows.
> 
> CC: Alin Gabriel Serdean <[email protected]>
> CC: Aaron Conole <[email protected]>
> Signed-off-by: Bhanuprakash Bodireddy
> <[email protected]>
> ---
>  lib/util.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/lib/util.c b/lib/util.c
> index a29e288..46b5691 100644
> --- a/lib/util.c
> +++ b/lib/util.c
> @@ -2217,6 +2217,23 @@ xnanosleep(uint64_t nanoseconds)
>          retval = nanosleep(&ts_sleep, NULL);
>          error = retval < 0 ? errno : 0;
>      } while (error == EINTR);
> +#else
> +    HANDLE timer = CreateWaitableTimer(NULL, FALSE, "NSTIMER");
[Alin Serdean] Small nit we don't need to name the timer because we don't
reuse it.
> +    if (timer) {
> +        LARGE_INTEGER duetime;
> +        duetime.QuadPart = -nanoseconds;
> +        if (SetWaitableTimer(timer, &duetime, 0, NULL, NULL, FALSE)) {
> +            WaitForSingleObject(timer, INFINITE);
> +            CloseHandle(timer);
> +        } else {
> +            CloseHandle(timer);
> +            VLOG_ERR_ONCE("SetWaitableTimer Failed (%s)",
> +                           ovs_lasterror_to_string());
> +        }
[Alin Serdean] Can you move the CloseHandle part here?
> +    } else {
> +        VLOG_ERR_ONCE("CreateWaitableTimer Failed (%s)",
> +                       ovs_lasterror_to_string());
> +    }
>  #endif
>      ovsrcu_quiesce_end();
>  }
> --
> 2.4.11
> 
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to