Andrew Svetlov added the comment:
Raymond, is there known custom third-party queue class derived from
queue.Queue? I believe all those are in stdlib only.
Also locking guarantee is promised by comment in source code only,
documentation says nothing about it.
I believe proposed change will
Serhiy Storchaka added the comment:
Yes, there are.
https://code.openhub.net/search?s=%22def%20_qsize%22%20%22import%20Queue%22pp=0ff=1mp=1ml=1me=1md=1filterChecked=true
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - not a bug
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24411
___
Changes by Yury Selivanov yseliva...@gmail.com:
--
nosy: +yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24411
___
___
Python-bugs-list
Changes by Andrew Svetlov andrew.svet...@gmail.com:
--
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24411
___
___
New submission from Andrew Svetlov:
Now those methods use lock for querying queue size, like
def qsize(self):
with self.mutex:
return self._qsize()
The lock is not necessary because thread context switch may be done *after*
returning from mutex protected code but
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24411
___
Raymond Hettinger added the comment:
It may seem pointless to hold the lock, but it is guaranteed behavior (and has
been so for a very, very long time).
'''
# Override these methods to implement other queue organizations
#