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

Unified Diff: tests/skia_test.cpp

Issue 26470005: SkThreadPool: tweak two little things that have been annoying me (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: reup Created 7 years, 2 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/OnceTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/skia_test.cpp
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 620cdac9ca69fad6d075c6d1ef5c3bb908e0c0e2..b8f80e0c4b54662cf5df300c3aa95d82b597e0c5 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -8,7 +8,6 @@
#include "SkCommandLineFlags.h"
#include "SkGraphics.h"
#include "SkOSFile.h"
-#include "SkRunnable.h"
#include "SkTArray.h"
#include "SkTemplates.h"
#include "SkThreadPool.h"
@@ -229,7 +228,7 @@ int tool_main(int argc, char** argv) {
int32_t failCount = 0;
int skipCount = 0;
- SkAutoTDelete<SkThreadPool> threadpool(SkNEW_ARGS(SkThreadPool, (FLAGS_threads)));
+ SkThreadPool threadpool(FLAGS_threads);
SkTArray<Test*> unsafeTests; // Always passes ownership to an SkTestRunnable
for (int i = 0; i < total; i++) {
SkAutoTDelete<Test> test(iter.next());
@@ -238,7 +237,7 @@ int tool_main(int argc, char** argv) {
} else if (!test->isThreadsafe()) {
unsafeTests.push_back() = test.detach();
} else {
- threadpool->add(SkNEW_ARGS(SkTestRunnable, (test.detach(), &failCount)));
+ threadpool.add(SkNEW_ARGS(SkTestRunnable, (test.detach(), &failCount)));
}
}
@@ -247,8 +246,8 @@ int tool_main(int argc, char** argv) {
SkNEW_ARGS(SkTestRunnable, (unsafeTests[i], &failCount))->run();
}
- // Blocks until threaded tests finish.
- threadpool.free();
+ // Block until threaded tests finish.
+ threadpool.wait();
SkDebugf("Finished %d tests, %d failures, %d skipped.\n",
toRun, failCount, skipCount);
« no previous file with comments | « tests/OnceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698