summaryrefslogtreecommitdiffstats
path: root/runtime/thread_pool_test.cc
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-17 21:52:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-17 21:52:25 -0700
commitb267c89acd0fcda0e8e2a9eeaeeed9ee048d1abc (patch)
tree6c6cdd913669f09eff4c3aa2b820a39ed0f3a937 /runtime/thread_pool_test.cc
parent397f477582243bdffed603a73ff5a06ee295d7fb (diff)
parent93ba893c20532990a430741e0a97212900094e8c (diff)
downloadart-b267c89acd0fcda0e8e2a9eeaeeed9ee048d1abc.zip
art-b267c89acd0fcda0e8e2a9eeaeeed9ee048d1abc.tar.gz
art-b267c89acd0fcda0e8e2a9eeaeeed9ee048d1abc.tar.bz2
am 93ba893c: Fix cpplint runtime/explicit issues
* commit '93ba893c20532990a430741e0a97212900094e8c': Fix cpplint runtime/explicit issues
Diffstat (limited to 'runtime/thread_pool_test.cc')
-rw-r--r--runtime/thread_pool_test.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc
index 4717ce7..10954e8 100644
--- a/runtime/thread_pool_test.cc
+++ b/runtime/thread_pool_test.cc
@@ -25,8 +25,7 @@ namespace art {
class CountTask : public Task {
public:
- CountTask(AtomicInteger* count) : count_(count), verbose_(false) {
- }
+ explicit CountTask(AtomicInteger* count) : count_(count), verbose_(false) {}
void Run(Thread* self) {
if (verbose_) {
@@ -61,7 +60,7 @@ int32_t ThreadPoolTest::num_threads = 4;
TEST_F(ThreadPoolTest, CheckRun) {
Thread* self = Thread::Current();
ThreadPool thread_pool(num_threads);
- AtomicInteger count = 0;
+ AtomicInteger count(0);
static const int32_t num_tasks = num_threads * 4;
for (int32_t i = 0; i < num_tasks; ++i) {
thread_pool.AddTask(self, new CountTask(&count));
@@ -76,7 +75,7 @@ TEST_F(ThreadPoolTest, CheckRun) {
TEST_F(ThreadPoolTest, StopStart) {
Thread* self = Thread::Current();
ThreadPool thread_pool(num_threads);
- AtomicInteger count = 0;
+ AtomicInteger count(0);
static const int32_t num_tasks = num_threads * 4;
for (int32_t i = 0; i < num_tasks; ++i) {
thread_pool.AddTask(self, new CountTask(&count));
@@ -88,7 +87,7 @@ TEST_F(ThreadPoolTest, StopStart) {
thread_pool.StartWorkers(self);
usleep(200);
thread_pool.StopWorkers(self);
- AtomicInteger bad_count = 0;
+ AtomicInteger bad_count(0);
thread_pool.AddTask(self, new CountTask(&bad_count));
usleep(200);
// Ensure that the task added after the workers were stopped doesn't get run.
@@ -133,7 +132,7 @@ class TreeTask : public Task {
TEST_F(ThreadPoolTest, RecursiveTest) {
Thread* self = Thread::Current();
ThreadPool thread_pool(num_threads);
- AtomicInteger count = 0;
+ AtomicInteger count(0);
static const int depth = 8;
thread_pool.AddTask(self, new TreeTask(&thread_pool, &count, depth));
thread_pool.StartWorkers(self);