]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix bug with IOLoop's 'waker' pipe which rendered it ineffective on linux
authorBen Darnell <bdarnell@beaker.local>
Tue, 9 Mar 2010 17:17:23 +0000 (09:17 -0800)
committerBen Darnell <bdarnell@beaker.local>
Tue, 9 Mar 2010 17:17:23 +0000 (09:17 -0800)
and mac (where pipes are unidirectional) and caused high cpu usage
on solaris (where pipes are bidirectional).  Thanks to Jari Ahonen for
finding the bug.

tornado/ioloop.py

index aabf5118aebc58de9b366f7de1c4db1fe3c9a55b..b2a105673fa13579886726f99928460e74976b1c 100644 (file)
@@ -99,7 +99,7 @@ class IOLoop(object):
         self._set_close_exec(w)
         self._waker_reader = os.fdopen(r, "r", 0)
         self._waker_writer = os.fdopen(w, "w", 0)
-        self.add_handler(r, self._read_waker, self.WRITE)
+        self.add_handler(r, self._read_waker, self.READ)
 
     @classmethod
     def instance(cls):