select: Add epoll.unregister() method.

asyncio-segfault
Paul Sokolovsky 2014-04-24 00:59:43 +03:00
rodzic 808b492612
commit 84f3cbb7cc
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -42,6 +42,11 @@ class Epoll:
r = epoll_ctl(self.epfd, EPOLL_CTL_MOD, fd, s)
os.check_error(r)
def unregister(self, fd):
# Pass dummy event structure, to workaround kernel bug
r = epoll_ctl(self.epfd, EPOLL_CTL_DEL, fd, self.evbuf)
os.check_error(r)
def poll(self, timeout=-1):
s = bytearray(self.evbuf)
n = epoll_wait(self.epfd, s, 1, timeout)

Wyświetl plik

@ -5,7 +5,7 @@ sys.path.pop(0)
from setuptools import setup
setup(name='micropython-select',
version='0.0.2',
version='0.0.3',
description='select module to MicroPython',
url='https://github.com/micropython/micropython/issues/405',
author='Paul Sokolovsky',