Commit b580f89b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d3f8b74c
...@@ -164,7 +164,7 @@ class Serialized(object): ...@@ -164,7 +164,7 @@ class Serialized(object):
@classmethod @classmethod
def _sort_key(cls, fd_event): def _sort_key(cls, fd_event):
return -cls._fd_dict[fd_event[0]]._last return -cls._fd_dict[fd_event[0]]._last # NOTE ._last set to time.time()
@classmethod @classmethod
@contextmanager @contextmanager
...@@ -198,11 +198,11 @@ class Serialized(object): ...@@ -198,11 +198,11 @@ class Serialized(object):
with cls._busy_cond: with cls._busy_cond:
while cls._busy: while cls._busy:
cls._busy_cond.wait() cls._busy_cond.wait()
for app in check_timeout: for app in check_timeout: # XXX hack (?), used only in 1 place
app.em.epoll.check_timeout = True app.em.epoll.check_timeout = True
app.em.wakeup() app.em.wakeup()
del app del app
while step: while step: # used as step=-1 (default), =1 (twice), =2 (once)
event_list = cls._epoll.poll(0) event_list = cls._epoll.poll(0)
if not event_list: if not event_list:
break break
...@@ -212,7 +212,8 @@ class Serialized(object): ...@@ -212,7 +212,8 @@ class Serialized(object):
for fd, event in event_list: for fd, event in event_list:
self = cls._fd_dict[fd] self = cls._fd_dict[fd]
self._release_next = next_lock.release self._release_next = next_lock.release
next_lock = self._lock next_lock = self._lock # XXX what is self._lock
# XXX ? set in .release_next() ?
del self del self
next_lock.release() next_lock.release()
cls._sched_lock.acquire() cls._sched_lock.acquire()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment