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

Unified Diff: tests/OnceTest.cpp

Issue 531653002: SkThreadPool ~~> SkTaskGroup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Lazy and leaky -> proactive and clean. Created 6 years, 3 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 | « src/utils/SkThreadPool.h ('k') | tests/PathOpsExtendedTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/OnceTest.cpp
diff --git a/tests/OnceTest.cpp b/tests/OnceTest.cpp
index 389d257b73fdb3a8aa25be023f6f48750cd2bb2f..192abaaee36266c81ceb3e7773b8ae524415a669 100644
--- a/tests/OnceTest.cpp
+++ b/tests/OnceTest.cpp
@@ -6,7 +6,7 @@
*/
#include "SkOnce.h"
-#include "SkThreadPool.h"
+#include "SkTaskGroup.h"
#include "Test.h"
static void add_five(int* x) {
@@ -42,7 +42,7 @@ public:
};
DEF_TEST(SkOnce_Multithreaded, r) {
- const int kTasks = 16, kThreads = 4;
+ const int kTasks = 16;
// Make a bunch of tasks that will race to be the first to add six to x.
Racer racers[kTasks];
@@ -54,11 +54,11 @@ DEF_TEST(SkOnce_Multithreaded, r) {
}
// Let them race.
- SkThreadPool pool(kThreads);
+ SkTaskGroup tg;
for (int i = 0; i < kTasks; i++) {
- pool.add(&racers[i]);
+ tg.add(&racers[i]);
}
- pool.wait();
+ tg.wait();
// Only one should have done the +=.
REPORTER_ASSERT(r, 6 == x);
« no previous file with comments | « src/utils/SkThreadPool.h ('k') | tests/PathOpsExtendedTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698