Andrew Svetlov <andrew.svet...@gmail.com> added the comment:
Or, maybe, there is a way to do everything without changing public API. The idea is: _wake_up_next can create a future which is set by *waked up task* on its acquiring. acquire method should wait for this future first before entering in `while self._value < 0:` loop. If the future is cancelled, `_wake_up_next` should be called again and waiting for the next future acquiring to be performed. If there is no *acquire waiting* future exists -- do everything as usual. All other lock objects should be modified also. ---------- title: asyncio.Semaphore waiters deqeueu doesn't work -> asyncio.Semaphore waiters deque doesn't work type: -> behavior versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45997> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com