mirror of
https://github.com/openvswitch/ovs
synced 2025-10-21 14:49:41 +00:00
python: timer_wait_until calculated current time incorrectly
The timer_wait_until function in poller.py was using Time.msec to figure out the current time. Unfortunately, Time.msec does not in exist. Changed to use ovs.timeval.msec .
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
import errno
|
import errno
|
||||||
import logging
|
import logging
|
||||||
import select
|
import select
|
||||||
|
import ovs.timeval
|
||||||
|
|
||||||
class Poller(object):
|
class Poller(object):
|
||||||
"""High-level wrapper around the "poll" system call.
|
"""High-level wrapper around the "poll" system call.
|
||||||
@@ -62,15 +63,15 @@ class Poller(object):
|
|||||||
self.__timer_wait(msec)
|
self.__timer_wait(msec)
|
||||||
|
|
||||||
def timer_wait_until(self, msec):
|
def timer_wait_until(self, msec):
|
||||||
"""Causes the following call to self.block() to wake up when the
|
"""Causes the following call to self.block() to wake up when the current
|
||||||
current time, as returned by Time.msec(), reaches 'msec' or later. If
|
time, as returned by ovs.timeval.msec(), reaches 'msec' or later. If
|
||||||
'msec' is earlier than the current time, the following call to
|
'msec' is earlier than the current time, the following call to
|
||||||
self.block() will not block at all.
|
self.block() will not block at all.
|
||||||
|
|
||||||
The timer registration is one-shot: only the following call to
|
The timer registration is one-shot: only the following call to
|
||||||
self.block() is affected. The timer will need to be re-registered
|
self.block() is affected. The timer will need to be re-registered
|
||||||
after self.block() is called if it is to persist."""
|
after self.block() is called if it is to persist."""
|
||||||
now = Time.msec()
|
now = ovs.timeval.msec()
|
||||||
if msec <= now:
|
if msec <= now:
|
||||||
self.immediate_wake()
|
self.immediate_wake()
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user