Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(23)

Unified Diff: Lib/threading.py

Issue 19817: tracemalloc add a memory limit feature
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/unittest/case.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/threading.py Wed Dec 04 01:47:46 2013 +0100
+++ b/Lib/threading.py Wed Dec 04 02:02:18 2013 +0100
@@ -16,6 +16,8 @@ try:
except ImportError:
from collections import deque as _deque
+import tracemalloc
+
# Note regarding PEP 8 compliant names
# This threading model was originally inspired by Java, and inherited
# the convention of camelCase function and method names from that
@@ -848,6 +850,7 @@ class Thread:
with _active_limbo_lock:
_limbo[self] = self
try:
+ tracemalloc.stop()
_start_new_thread(self._bootstrap, ())
except Exception:
with _active_limbo_lock:
@@ -885,6 +888,7 @@ class Thread:
# _bootstrap_inner() during normal business hours are properly
# reported. Also, we only suppress them for daemonic threads;
# if a non-daemonic encounters this, something else is wrong.
+ tracemalloc.stop()
try:
self._bootstrap_inner()
except:
« no previous file with comments | « no previous file | Lib/unittest/case.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+