From bcd5e9daecad39f0dab3246808b4835caec29ea6 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 13 Nov 2013 14:33:28 -0800 Subject: Manually manage thread pool stacks. We now allocate the thread pool worker stack using a MemMap. This enables us to name the maps so that we get more descriptive output for debugging leaks. Appears to fix the mips build 5/5 successful clean-oat and builds. This is probably since glibc caches up to 40 MB of thread stacks before releasing them. Change-Id: I1df2de50cb95838aa0d272a09807021404ba410c --- runtime/thread_pool_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/thread_pool_test.cc') diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc index 9b789d2..1b22361 100644 --- a/runtime/thread_pool_test.cc +++ b/runtime/thread_pool_test.cc @@ -59,7 +59,7 @@ int32_t ThreadPoolTest::num_threads = 4; // Check that the thread pool actually runs tasks that you assign it. TEST_F(ThreadPoolTest, CheckRun) { Thread* self = Thread::Current(); - ThreadPool thread_pool(num_threads); + ThreadPool thread_pool("Thread pool test thread pool", num_threads); AtomicInteger count(0); static const int32_t num_tasks = num_threads * 4; for (int32_t i = 0; i < num_tasks; ++i) { @@ -74,7 +74,7 @@ TEST_F(ThreadPoolTest, CheckRun) { TEST_F(ThreadPoolTest, StopStart) { Thread* self = Thread::Current(); - ThreadPool thread_pool(num_threads); + ThreadPool thread_pool("Thread pool test thread pool", num_threads); AtomicInteger count(0); static const int32_t num_tasks = num_threads * 4; for (int32_t i = 0; i < num_tasks; ++i) { @@ -129,7 +129,7 @@ class TreeTask : public Task { // Test that adding new tasks from within a task works. TEST_F(ThreadPoolTest, RecursiveTest) { Thread* self = Thread::Current(); - ThreadPool thread_pool(num_threads); + ThreadPool thread_pool("Thread pool test thread pool", num_threads); AtomicInteger count(0); static const int depth = 8; thread_pool.AddTask(self, new TreeTask(&thread_pool, &count, depth)); -- cgit v1.1