10000 Revert "bpo-37788: Fix a reference leak if a thread is not joined (GH… · python/cpython@d11c2c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit d11c2c6

Browse files
authored
Revert "bpo-37788: Fix a reference leak if a thread is not joined (GH-15228)" (GH-15338)
This reverts commit d3dcc92.
1 parent d3dcc92 commit d11c2c6

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

Lib/test/test_threading.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -761,14 +761,6 @@ def test_shutdown_locks(self):
761761
# Daemon threads must never add it to _shutdown_locks.
762762
self.assertNotIn(tstate_lock, threading._shutdown_locks)
763763

764-
def test_leak_without_join(self):
765-
# bpo-37788: Test that a thread which is not joined explicitly
766-
# does not leak. Test written for reference leak checks.
767-
def noop(): pass
768-
with support.wait_threads_exit():
769-
threading.Thread(target=noop).start()
770-
# Thread.join() is not called
771-
772764

773765
class ThreadJoinOnShutdown(BaseTestCase):
774766

Lib/threading.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -806,16 +806,6 @@ class is implemented.
806806
# For debugging and _after_fork()
807807
_dangling.add(self)
808808

809-
def __del__(self):
810-
if not self._initialized:
811-
return
812-
lock = self._tstate_lock
813-
if lock is not None and not self.daemon:
814-
# ensure that self._tstate_lock is not in _shutdown_locks
815-
# if join() was not called explicitly
816-
with _shutdown_locks_lock:
817-
_shutdown_locks.discard(lock)
818-
819809
def _reset_internal_locks(self, is_alive):
820810
# private! Called by _after_fork() to reset our internal locks as
821811
# 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

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)
0