Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SkExecutor Class Referenceabstract

#include <SkExecutor.h>

Inheritance diagram for SkExecutor:
SkThreadPool< WorkList > SkTrivialExecutor flutter::SkiaConcurrentExecutor

Public Member Functions

virtual ~SkExecutor ()
 
virtual void add (std::function< void(void)>)=0
 
virtual void borrow ()
 

Static Public Member Functions

static std::unique_ptr< SkExecutorMakeFIFOThreadPool (int threads=0, bool allowBorrowing=true)
 
static std::unique_ptr< SkExecutorMakeLIFOThreadPool (int threads=0, bool allowBorrowing=true)
 
static SkExecutorGetDefault ()
 
static void SetDefault (SkExecutor *)
 

Protected Member Functions

 SkExecutor ()=default
 
 SkExecutor (const SkExecutor &)=delete
 
SkExecutoroperator= (const SkExecutor &)=delete
 

Detailed Description

Definition at line 15 of file SkExecutor.h.

Constructor & Destructor Documentation

◆ ~SkExecutor()

SkExecutor::~SkExecutor ( )
virtual

Definition at line 34 of file SkExecutor.cpp.

34{}

◆ SkExecutor() [1/2]

SkExecutor::SkExecutor ( )
protecteddefault

◆ SkExecutor() [2/2]

SkExecutor::SkExecutor ( const SkExecutor )
protecteddelete

Member Function Documentation

◆ add()

virtual void SkExecutor::add ( std::function< void(void)>  )
pure virtual

Implemented in SkThreadPool< WorkList >.

◆ borrow()

virtual void SkExecutor::borrow ( )
inlinevirtual

Reimplemented in SkThreadPool< WorkList >.

Definition at line 33 of file SkExecutor.h.

33{}

◆ GetDefault()

SkExecutor & SkExecutor::GetDefault ( )
static

Definition at line 50 of file SkExecutor.cpp.

50 {
51 if (gDefaultExecutor) {
52 return *gDefaultExecutor;
53 }
54 return trivial_executor();
55}
static SkExecutor & trivial_executor()
Definition: SkExecutor.cpp:43
static SkExecutor * gDefaultExecutor
Definition: SkExecutor.cpp:48

◆ MakeFIFOThreadPool()

std::unique_ptr< SkExecutor > SkExecutor::MakeFIFOThreadPool ( int  threads = 0,
bool  allowBorrowing = true 
)
static

Definition at line 146 of file SkExecutor.cpp.

146 {
147 using WorkList = std::deque<std::function<void(void)>>;
148 return std::make_unique<SkThreadPool<WorkList>>(threads > 0 ? threads : num_cores(),
149 allowBorrowing);
150}
static int num_cores()
Definition: SkExecutor.cpp:29
Dart_NativeFunction function
Definition: fuchsia.cc:51

◆ MakeLIFOThreadPool()

std::unique_ptr< SkExecutor > SkExecutor::MakeLIFOThreadPool ( int  threads = 0,
bool  allowBorrowing = true 
)
static

Definition at line 151 of file SkExecutor.cpp.

151 {
152 using WorkList = TArray<std::function<void(void)>>;
153 return std::make_unique<SkThreadPool<WorkList>>(threads > 0 ? threads : num_cores(),
154 allowBorrowing);
155}

◆ operator=()

SkExecutor & SkExecutor::operator= ( const SkExecutor )
protecteddelete

◆ SetDefault()

void SkExecutor::SetDefault ( SkExecutor executor)
static

Definition at line 57 of file SkExecutor.cpp.

57 {
58 gDefaultExecutor = executor;
59}

The documentation for this class was generated from the following files: