Merge "Fix valgrind issue with thread_pool_test."
diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc
index 89e9005..14c2c3b 100644
--- a/runtime/thread_pool_test.cc
+++ b/runtime/thread_pool_test.cc
@@ -114,8 +114,11 @@
   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 {