mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-114706: Allow QueueListener.stop() to be called more than once. (GH-114748)
This commit is contained in:
parent
ea30a28c3e
commit
e21754d7f8
2 changed files with 5 additions and 3 deletions
|
@ -1586,6 +1586,7 @@ class QueueListener(object):
|
|||
Note that if you don't call this before your application exits, there
|
||||
may be some records still left on the queue, which won't be processed.
|
||||
"""
|
||||
self.enqueue_sentinel()
|
||||
self._thread.join()
|
||||
self._thread = None
|
||||
if self._thread: # see gh-114706 - allow calling this more than once
|
||||
self.enqueue_sentinel()
|
||||
self._thread.join()
|
||||
self._thread = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue