Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(817)

Unified Diff: runtime/vm/thread_pool_test.cc

Issue 850183003: During thread-pool shutdown, wait for worker threads to shutdown. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread_pool.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_pool_test.cc
===================================================================
--- runtime/vm/thread_pool_test.cc (revision 45833)
+++ runtime/vm/thread_pool_test.cc (working copy)
@@ -12,18 +12,6 @@
DECLARE_FLAG(int, worker_timeout_millis);
-class ThreadPoolTestPeer {
- public:
- // When the pool has an exit monitor, workers notify a monitor just
- // before they exit. This is only used in tests to make sure that
- // Shutdown works.
- static void SetExitMonitor(Monitor* exit_monitor, int* exit_count) {
- ThreadPool::exit_monitor_ = exit_monitor;
- ThreadPool::exit_count_ = exit_count;
- }
-};
-
-
UNIT_TEST_CASE(ThreadPool_Create) {
ThreadPool thread_pool;
}
@@ -101,30 +89,6 @@
};
-UNIT_TEST_CASE(ThreadPool_WorkerShutdown) {
- Monitor exit_sync;
- int exit_count = 0;
- MonitorLocker ml(&exit_sync);
-
- // Set up the ThreadPool so that workers notify before they exit.
- ThreadPool* thread_pool = new ThreadPool();
- ThreadPoolTestPeer::SetExitMonitor(&exit_sync, &exit_count);
-
- // Run a single task.
- thread_pool->Run(new SleepTask(2));
-
- // Kill the thread pool.
- delete thread_pool;
- thread_pool = NULL;
-
- // Wait for the workers to terminate.
- while (exit_count == 0) {
- ml.Wait();
- }
- EXPECT_EQ(1, exit_count);
-}
-
-
UNIT_TEST_CASE(ThreadPool_WorkerTimeout) {
// Adjust the worker timeout so that we timeout quickly.
int saved_timeout = FLAG_worker_timeout_millis;
« no previous file with comments | « runtime/vm/thread_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698