summaryrefslogtreecommitdiffstats
path: root/runtime/thread_pool_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread_pool_test.cc')
-rw-r--r--runtime/thread_pool_test.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc
index c1a1ad7..292c94f 100644
--- a/runtime/thread_pool_test.cc
+++ b/runtime/thread_pool_test.cc
@@ -69,7 +69,7 @@ TEST_F(ThreadPoolTest, CheckRun) {
// Wait for tasks to complete.
thread_pool.Wait(self, true, false);
// Make sure that we finished all the work.
- EXPECT_EQ(num_tasks, count);
+ EXPECT_EQ(num_tasks, count.LoadSequentiallyConsistent());
}
TEST_F(ThreadPoolTest, StopStart) {
@@ -82,7 +82,7 @@ TEST_F(ThreadPoolTest, StopStart) {
}
usleep(200);
// Check that no threads started prematurely.
- EXPECT_EQ(0, count);
+ EXPECT_EQ(0, count.LoadSequentiallyConsistent());
// Signal the threads to start processing tasks.
thread_pool.StartWorkers(self);
usleep(200);
@@ -91,10 +91,11 @@ TEST_F(ThreadPoolTest, StopStart) {
thread_pool.AddTask(self, new CountTask(&bad_count));
usleep(200);
// Ensure that the task added after the workers were stopped doesn't get run.
- EXPECT_EQ(0, bad_count);
+ EXPECT_EQ(0, bad_count.LoadSequentiallyConsistent());
// Allow tasks to finish up and delete themselves.
thread_pool.StartWorkers(self);
- while (count.Load() != num_tasks && bad_count.Load() != 1) {
+ while (count.LoadSequentiallyConsistent() != num_tasks &&
+ bad_count.LoadSequentiallyConsistent() != 1) {
usleep(200);
}
thread_pool.StopWorkers(self);
@@ -135,7 +136,7 @@ TEST_F(ThreadPoolTest, RecursiveTest) {
thread_pool.AddTask(self, new TreeTask(&thread_pool, &count, depth));
thread_pool.StartWorkers(self);
thread_pool.Wait(self, true, false);
- EXPECT_EQ((1 << depth) - 1, count);
+ EXPECT_EQ((1 << depth) - 1, count.LoadSequentiallyConsistent());
}
} // namespace art