]> git.ipfire.org Git - thirdparty/tornado.git/commit
In add_callback, hold the lock while writing to the waker pipe.
authorBen Darnell <ben@bendarnell.com>
Mon, 19 Aug 2013 03:54:59 +0000 (23:54 -0400)
committerBen Darnell <ben@bendarnell.com>
Mon, 19 Aug 2013 03:54:59 +0000 (23:54 -0400)
commit8e7effdaefaddc5b61ba0aa6ff8e94f1422b6092
tree20378cc3791aa74117848b1f77bd7934b15e6b5f
parent6ec711cded7be36079ee28047eb5ebedb5771955
In add_callback, hold the lock while writing to the waker pipe.

This protects against a shutdown race condition seen occasionally in
the ThreadedResolver unittests.  This slightly increases contention
on the callback lock in multi-threaded scenarios, but the cost is
limited by the fact that we only write to the pipe once per IOLoop
iteration.

Closes #875.
tornado/ioloop.py