summaryrefslogtreecommitdiffstats
path: root/tools/memory_inspector
diff options
context:
space:
mode:
authorpetrcermak <petrcermak@chromium.org>2015-01-19 06:51:16 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-19 14:52:10 +0000
commit1ff83e0cbc225d2495eb768311a9c21ac6d37433 (patch)
tree7ea31c3632f805206b69b29225988b9061147825 /tools/memory_inspector
parent4705e16ef3061a011d3404f8c3ba27ece285c8e0 (diff)
downloadchromium_src-1ff83e0cbc225d2495eb768311a9c21ac6d37433.zip
chromium_src-1ff83e0cbc225d2495eb768311a9c21ac6d37433.tar.gz
chromium_src-1ff83e0cbc225d2495eb768311a9c21ac6d37433.tar.bz2
Remove background_tasks.TerminateAll() function from Memory Inspector
Now that background tasks are threads, there is no direct way to terminate them. Instead, we set them to be daemon threads which will be automatically terminated when the main program exits. BUG=448399 Review URL: https://codereview.chromium.org/845733003 Cr-Commit-Position: refs/heads/master@{#312111}
Diffstat (limited to 'tools/memory_inspector')
-rw-r--r--tools/memory_inspector/memory_inspector/frontends/background_tasks.py8
-rw-r--r--tools/memory_inspector/memory_inspector/frontends/www_server.py1
2 files changed, 1 insertions, 8 deletions
diff --git a/tools/memory_inspector/memory_inspector/frontends/background_tasks.py b/tools/memory_inspector/memory_inspector/frontends/background_tasks.py
index 43e5f66..923fcf0 100644
--- a/tools/memory_inspector/memory_inspector/frontends/background_tasks.py
+++ b/tools/memory_inspector/memory_inspector/frontends/background_tasks.py
@@ -51,13 +51,6 @@ def Get(task_id):
return _tasks.get(task_id)
-def TerminateAll():
- for task in _tasks.itervalues():
- if task.is_alive():
- task.terminate()
- _tasks.clear()
-
-
def TracerMain_(log, storage_path, backend_name, device_id, pid, interval,
count, trace_native_heap):
"""Entry point for the background periodic tracer task."""
@@ -140,6 +133,7 @@ class BackgroundTask(threading.Thread):
target=entry_point,
args=((self._log_queue,) + args), # Just propagate all args.
kwargs=kwargs)
+ self.daemon = True
def run(self):
try:
diff --git a/tools/memory_inspector/memory_inspector/frontends/www_server.py b/tools/memory_inspector/memory_inspector/frontends/www_server.py
index c79112f..f8368fb 100644
--- a/tools/memory_inspector/memory_inspector/frontends/www_server.py
+++ b/tools/memory_inspector/memory_inspector/frontends/www_server.py
@@ -758,4 +758,3 @@ def Start(http_port):
httpd.serve_forever()
except KeyboardInterrupt:
pass # Don't print useless stack traces when the user hits CTRL-C.
- background_tasks.TerminateAll()