Hi Alin,

>Thanks a lot for the patch.
>
>I have a few comments inlined.
>
>> -----Original Message-----
>> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
>> boun...@openvswitch.org] On Behalf Of Bhanuprakash Bodireddy
>> Sent: Wednesday, November 8, 2017 6:36 PM
>> To: d...@openvswitch.org
>> Cc: Alin Gabriel Serdean <aserd...@ovn.org>
>> 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 <aserd...@ovn.org>
>> CC: Aaron Conole <acon...@redhat.com>
>> Signed-off-by: Bhanuprakash Bodireddy
>> <bhanuprakash.bodire...@intel.com>
>> ---
>>  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();
>>  }

Thanks for your comments. I will send across v2 with the above changes.

- Bhanuprakash. 

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to