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

Unified Diff: tests/OncePtrTest.cpp

Issue 1552093002: If we swap its arguments, SkTaskGroup::batch() _is_ sk_parallel_for. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 12 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 | « tests/BlendTest.cpp ('k') | tests/OnceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/OncePtrTest.cpp
diff --git a/tests/OncePtrTest.cpp b/tests/OncePtrTest.cpp
index 103172751a792a756be33692cf5120e814c2da76..d01cee09fe913932de27ce52a017d25821b50582 100644
--- a/tests/OncePtrTest.cpp
+++ b/tests/OncePtrTest.cpp
@@ -18,14 +18,7 @@ DEF_TEST(OncePtr, r) {
return new int(5);
};
- SkAtomic<int> force_a_race(sk_parallel_for_thread_count());
- if (force_a_race < 1) {
- return;
- }
- sk_parallel_for(sk_num_cores()*4, [&](size_t) {
- force_a_race.fetch_add(-1);
- while (force_a_race.load() > 0);
-
+ SkTaskGroup().batch(sk_num_cores()*4, [&](size_t) {
int* n = once.get(create);
REPORTER_ASSERT(r, *n == 5);
});
@@ -39,7 +32,7 @@ DEF_TEST(OnceNoPtr, r) {
static SkAtomic<int> calls(0);
SkAtomic<int> force_a_race(sk_num_cores());
- sk_parallel_for(sk_num_cores()*4, [&](size_t) {
+ SkTaskGroup().batch(sk_num_cores()*4, [&](size_t) {
force_a_race.fetch_add(-1);
while (force_a_race.load() > 0);
« no previous file with comments | « tests/BlendTest.cpp ('k') | tests/OnceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698