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

Side by Side Diff: base/threading/worker_pool_posix_unittest.cc

Issue 5977010: Move CancellationFlag and WaitableEvent to the synchronization subdirectory.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/threading/thread_local_unittest.cc ('k') | base/threading/worker_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/worker_pool_posix.h" 5 #include "base/threading/worker_pool_posix.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/lock.h" 9 #include "base/lock.h"
10 #include "base/synchronization/condition_variable.h" 10 #include "base/synchronization/condition_variable.h"
11 #include "base/task.h" 11 #include "base/task.h"
12 #include "base/threading/platform_thread.h" 12 #include "base/threading/platform_thread.h"
13 #include "base/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace base { 16 namespace base {
17 17
18 // Peer class to provide passthrough access to PosixDynamicThreadPool internals. 18 // Peer class to provide passthrough access to PosixDynamicThreadPool internals.
19 class PosixDynamicThreadPool::PosixDynamicThreadPoolPeer { 19 class PosixDynamicThreadPool::PosixDynamicThreadPoolPeer {
20 public: 20 public:
21 explicit PosixDynamicThreadPoolPeer(PosixDynamicThreadPool* pool) 21 explicit PosixDynamicThreadPoolPeer(PosixDynamicThreadPool* pool)
22 : pool_(pool) {} 22 : pool_(pool) {}
23 23
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Add another non blocking task. There are no threads to reuse. 259 // Add another non blocking task. There are no threads to reuse.
260 pool_->PostTask(CreateNewIncrementingTask()); 260 pool_->PostTask(CreateNewIncrementingTask());
261 WaitForIdleThreads(1); 261 WaitForIdleThreads(1);
262 262
263 EXPECT_EQ(3U, unique_threads_.size()); 263 EXPECT_EQ(3U, unique_threads_.size());
264 EXPECT_EQ(1, peer_.num_idle_threads()); 264 EXPECT_EQ(1, peer_.num_idle_threads());
265 EXPECT_EQ(4, counter_); 265 EXPECT_EQ(4, counter_);
266 } 266 }
267 267
268 } // namespace base 268 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_local_unittest.cc ('k') | base/threading/worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698