class SkTaskGroup : SkNoncopyable { public: // Tasks added to this SkTaskGroup will run on its executor. explicit SkTaskGroup(SkExecutor& executor = SkExecutor::GetDefault());
~SkTaskGroup() { this->wait(); }
// Add a task to this SkTaskGroup. void add(std::function<void(void)> fn);
// Add a batch of N tasks, all calling fn with different arguments. void batch(int N, std::function<void(int)> fn);
// Returns true if all Tasks previously add()ed to this SkTaskGroup have run. // It is safe to reuse this SkTaskGroup once done(). bool done() const;
// Block until done(). void wait();
// A convenience for testing tools. // Creates and owns a thread pool, and passes it to SkExecutor::SetDefault(). struct Enabler { explicit Enabler(int threads = -1); // -1 -> num_cores, 0 -> noop
std::unique_ptr<SkExecutor> fThreadPool;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.