Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d11c2c60
Commit
d11c2c60
authored
Aug 20, 2019
by
Victor Stinner
Committed by
GitHub
Aug 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "bpo-37788: Fix a reference leak if a thread is not joined (GH-15228)" (GH-15338)
This reverts commit
d3dcc927
.
parent
d3dcc927
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
19 deletions
+0
-19
Lib/test/test_threading.py
Lib/test/test_threading.py
+0
-8
Lib/threading.py
Lib/threading.py
+0
-10
Misc/NEWS.d/next/Library/2019-08-12-17-21-10.bpo-37788.F0tR05.rst
...S.d/next/Library/2019-08-12-17-21-10.bpo-37788.F0tR05.rst
+0
-1
No files found.
Lib/test/test_threading.py
View file @
d11c2c60
...
...
@@ -761,14 +761,6 @@ class ThreadTests(BaseTestCase):
# Daemon threads must never add it to _shutdown_locks.
self
.
assertNotIn
(
tstate_lock
,
threading
.
_shutdown_locks
)
def
test_leak_without_join
(
self
):
# bpo-37788: Test that a thread which is not joined explicitly
# does not leak. Test written for reference leak checks.
def
noop
():
pass
with
support
.
wait_threads_exit
():
threading
.
Thread
(
target
=
noop
).
start
()
# Thread.join() is not called
class
ThreadJoinOnShutdown
(
BaseTestCase
):
...
...
Lib/threading.py
View file @
d11c2c60
...
...
@@ -806,16 +806,6 @@ class Thread:
# For debugging and _after_fork()
_dangling
.
add
(
self
)
def
__del__
(
self
):
if
not
self
.
_initialized
:
return
lock
=
self
.
_tstate_lock
if
lock
is
not
None
and
not
self
.
daemon
:
# ensure that self._tstate_lock is not in _shutdown_locks
# if join() was not called explicitly
with
_shutdown_locks_lock
:
_shutdown_locks
.
discard
(
lock
)
def
_reset_internal_locks
(
self
,
is_alive
):
# private! Called by _after_fork() to reset our internal locks as
# they may be in an invalid state leading to a deadlock or crash.
...
...
Misc/NEWS.d/next/Library/2019-08-12-17-21-10.bpo-37788.F0tR05.rst
deleted
100644 → 0
View file @
d3dcc927
Fix a reference leak if a thread is not joined.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment