From a7538baeae619a513437f89b60cf738ee2de463d Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 10 Oct 2013 18:49:04 +0000 Subject: SkThreadPool: tweak two little things that have been annoying me 1) it's pretty annoying that SkThreadPool doesn't include SkRunnable for us; 2) add wait() so we don't have to keep using SkAutoTDelete/free() to wait for completion. BUG= R=scroggo@google.com, reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/26470005 git-svn-id: http://skia.googlecode.com/svn/trunk@11711 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/OnceTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/OnceTest.cpp') diff --git a/tests/OnceTest.cpp b/tests/OnceTest.cpp index 0b2aa9a857..74c88a40e1 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 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); -- cgit v1.2.3