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

Unified Diff: tests/OnceTest.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 | « src/utils/SkThreadPool.cpp ('k') | tests/skia_test.cpp » ('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 0b2aa9a8571a3e2bcbe44d014b969bb363c3da1f..74c88a40e19642796a2ca864d033a282e59ba896 100644
--- a/tests/OnceTest.cpp
+++ b/tests/OnceTest.cpp
@@ -6,7 +6,6 @@
*/
#include "SkOnce.h"
-#include "SkRunnable.h"
#include "SkThreadPool.h"
#include "Test.h"
#include "TestClassDef.h"
@@ -56,11 +55,11 @@ DEF_TEST(SkOnce_Multithreaded, r) {
}
// Let them race.
- SkAutoTDelete<SkThreadPool> pool(new SkThreadPool(kThreads));
+ SkThreadPool pool(kThreads);
for (int i = 0; i < kTasks; i++) {
- pool->add(&racers[i]);
+ pool.add(&racers[i]);
}
- pool.free(); // Blocks until all threads are done.
+ pool.wait();
// Only one should have done the +=.
REPORTER_ASSERT(r, 6 == x);
« no previous file with comments | « src/utils/SkThreadPool.cpp ('k') | tests/skia_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698