}
void PathOpsThreadedTestRunner::render() {
- fCountdown.reset(fRunnables.count());
+ SkThreadPool pool(fNumThreads);
for (int index = 0; index < fRunnables.count(); ++ index) {
- fThreadPool.add(fRunnables[index]);
+ pool.add(fRunnables[index]);
}
- fCountdown.wait();
#ifdef SK_DEBUG
gDebugMaxWindSum = SK_MaxS32;
gDebugMaxWindValue = SK_MaxS32;
public:
PathOpsThreadedTestRunner(skiatest::Reporter* reporter, int threadCount)
: fNumThreads(threadCount)
- , fThreadPool(threadCount)
- , fCountdown(threadCount)
, fReporter(reporter) {
}
public:
int fNumThreads;
SkTDArray<PathOpsThreadedRunnable*> fRunnables;
- SkThreadPool fThreadPool;
- SkCountdown fCountdown;
skiatest::Reporter* fReporter;
};
fState.fD = d;
fState.fReporter = runner->fReporter;
fTestFun = testFun;
- fDone = &runner->fCountdown;
}
virtual void run() SK_OVERRIDE {
char pathStr[PATH_STR_SIZE];
fState.fPathStr = pathStr;
(*fTestFun)(&fState);
- fDone->run();
}
private:
PathOpsThreadState fState;
void (*fTestFun)(PathOpsThreadState*);
- SkRunnable* fDone;
};
#endif