From 84f3cbb7cc3fa596d029644fa986e6ebc918b63f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 24 Apr 2014 00:59:43 +0300 Subject: [PATCH] select: Add epoll.unregister() method. --- select/select.py | 5 +++++ select/setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/select/select.py b/select/select.py index 9efb0915..4d63fc6f 100644 --- a/select/select.py +++ b/select/select.py @@ -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) diff --git a/select/setup.py b/select/setup.py index 24c6a0c2..5cd53c2a 100644 --- a/select/setup.py +++ b/select/setup.py @@ -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',