Lines Matching refs:n
15 for (int n = 0; n < 10; ++n) { in TEST() local
22 EXPECT_FALSE(cv.WaitFor(&mutex, TimeDelta::FromMicroseconds(n))); in TEST()
25 EXPECT_FALSE(cv.WaitFor(&mutex, TimeDelta::FromMicroseconds(n))); in TEST()
64 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
65 LockGuard<Mutex> lock_guard(&threads[n].mutex_); in TEST()
66 EXPECT_FALSE(threads[n].running_); in TEST()
67 EXPECT_FALSE(threads[n].finished_); in TEST()
68 threads[n].Start(); in TEST()
70 while (!threads[n].running_) { in TEST()
71 threads[n].cv_.Wait(&threads[n].mutex_); in TEST()
75 for (int n = kThreadCount - 1; n >= 0; --n) { in TEST() local
76 LockGuard<Mutex> lock_guard(&threads[n].mutex_); in TEST()
77 EXPECT_TRUE(threads[n].running_); in TEST()
78 EXPECT_FALSE(threads[n].finished_); in TEST()
81 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
82 LockGuard<Mutex> lock_guard(&threads[n].mutex_); in TEST()
83 EXPECT_TRUE(threads[n].running_); in TEST()
84 EXPECT_FALSE(threads[n].finished_); in TEST()
86 threads[n].running_ = false; in TEST()
87 threads[n].cv_.NotifyOne(); in TEST()
90 for (int n = kThreadCount - 1; n >= 0; --n) { in TEST() local
92 LockGuard<Mutex> lock_guard(&threads[n].mutex_); in TEST()
93 while (!threads[n].finished_) { in TEST()
94 threads[n].cv_.Wait(&threads[n].mutex_); in TEST()
96 EXPECT_FALSE(threads[n].running_); in TEST()
97 EXPECT_TRUE(threads[n].finished_); in TEST()
100 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
101 threads[n].Join(); in TEST()
102 LockGuard<Mutex> lock_guard(&threads[n].mutex_); in TEST()
103 EXPECT_FALSE(threads[n].running_); in TEST()
104 EXPECT_TRUE(threads[n].finished_); in TEST()
147 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
148 threads[n].mutex_ = &mutex; in TEST()
149 threads[n].cv_ = &cv; in TEST()
155 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
156 EXPECT_FALSE(threads[n].running_); in TEST()
157 EXPECT_FALSE(threads[n].finished_); in TEST()
158 threads[n].Start(); in TEST()
165 for (int n = kThreadCount - 1; n >= 0; --n) { in TEST() local
166 while (!threads[n].running_) { in TEST()
175 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
176 EXPECT_TRUE(threads[n].running_); in TEST()
177 EXPECT_FALSE(threads[n].finished_); in TEST()
184 for (int n = kThreadCount - 1; n >= 0; --n) { in TEST() local
185 EXPECT_TRUE(threads[n].running_); in TEST()
186 EXPECT_FALSE(threads[n].finished_); in TEST()
188 threads[n].running_ = false; in TEST()
196 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
197 while (!threads[n].finished_) { in TEST()
206 for (int n = kThreadCount - 1; n >= 0; --n) { in TEST() local
207 EXPECT_FALSE(threads[n].running_); in TEST()
208 EXPECT_TRUE(threads[n].finished_); in TEST()
213 for (int n = 0; n < kThreadCount; ++n) { in TEST() local
214 threads[n].Join(); in TEST()
279 for (int n = 0; n < thread_count; ++n) { in TEST() local
280 threads[n] = new LoopIncrementThread(n, &counter, limit, thread_count, in TEST()
285 for (int n = thread_count - 1; n >= 0; --n) { in TEST() local
286 threads[n]->Start(); in TEST()
290 for (int n = 0; n < thread_count; ++n) { in TEST() local
291 threads[n]->Join(); in TEST()
292 delete threads[n]; in TEST()