Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protocol: add a lock around StreamWriter.drain(), closes #16
Works around the following error: File /usr/lib/python3.4/asyncio/streams.py, line 194, in _drain_helper assert waiter is None or waiter.cancelled() AssertionError when the write buffer reaches the high watermark (and thus blocks) and 2+ tasks try to call drain(). Clearly, asyncio's current code (all versions up to 3.6.1 included) is not "thread" safe. So use a lock around the only place drain() is called.
- Loading branch information