kopia lustrzana https://github.com/micropython/micropython-lib
select: Add epoll.unregister() method.
rodzic
808b492612
commit
84f3cbb7cc
|
@ -42,6 +42,11 @@ class Epoll:
|
||||||
r = epoll_ctl(self.epfd, EPOLL_CTL_MOD, fd, s)
|
r = epoll_ctl(self.epfd, EPOLL_CTL_MOD, fd, s)
|
||||||
os.check_error(r)
|
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):
|
def poll(self, timeout=-1):
|
||||||
s = bytearray(self.evbuf)
|
s = bytearray(self.evbuf)
|
||||||
n = epoll_wait(self.epfd, s, 1, timeout)
|
n = epoll_wait(self.epfd, s, 1, timeout)
|
||||||
|
|
|
@ -5,7 +5,7 @@ sys.path.pop(0)
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(name='micropython-select',
|
setup(name='micropython-select',
|
||||||
version='0.0.2',
|
version='0.0.3',
|
||||||
description='select module to MicroPython',
|
description='select module to MicroPython',
|
||||||
url='https://github.com/micropython/micropython/issues/405',
|
url='https://github.com/micropython/micropython/issues/405',
|
||||||
author='Paul Sokolovsky',
|
author='Paul Sokolovsky',
|
||||||
|
|
Ładowanie…
Reference in New Issue