summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-11-18 15:06:21 -0800
committer Andreas Gampe <agampe@google.com> 2016-11-18 15:06:21 -0800
commit1013bdeacffb39b160a6a9e4ea4027930c955e7a (patch)
tree0895bf5691ad5013435192bb734777ce30024292
parent3bf14d69ab1823ae3e3ff372ac04a404044c3682 (diff)
Fix valgrind issue with thread_pool_test.
Make sure the task list is empty at the end of the test. Follow-up to commit e2fc98e88106b9cfa44eeacc6765c291feda04a8. Test: m test-art-host-gtest-thread_pool_test Test: m valgrind-test-art-host-gtest-thread_pool_test Change-Id: Ib41a1f7dde9d45f1195e18ff6db4241fb7dc7428
-rw-r--r--runtime/thread_pool_test.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc
index 89e9005c1a..14c2c3bac8 100644
--- a/runtime/thread_pool_test.cc
+++ b/runtime/thread_pool_test.cc
@@ -114,8 +114,11 @@ TEST_F(ThreadPoolTest, StopWait) {
thread_pool.StopWorkers(self);
thread_pool.Wait(self, false, false); // We should not deadlock here.
- // Drain the task list.
- thread_pool.Wait(self, /* do_work */ true, false); // We should not deadlock here.
+
+ // Drain the task list. Note: we have to restart here, as no tasks will be finished when
+ // the pool is stopped.
+ thread_pool.StartWorkers(self);
+ thread_pool.Wait(self, /* do_work */ true, false);
}
class TreeTask : public Task {