Flutter Engine
The Flutter Engine
Classes | Functions | Variables
SkExecutor.cpp File Reference
#include "include/core/SkExecutor.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkSemaphore.h"
#include "include/private/base/SkTArray.h"
#include "src/base/SkNoDestructor.h"
#include <deque>
#include <thread>
#include <utility>
#include <unistd.h>

Go to the source code of this file.

Classes

class  SkTrivialExecutor
 
class  SkThreadPool< WorkList >
 

Functions

static int num_cores ()
 
static SkExecutortrivial_executor ()
 
static std::function< void(void)> pop (std::deque< std::function< void(void)> > *list)
 
static std::function< void(void)> pop (TArray< std::function< void(void)> > *list)
 

Variables

static SkExecutorgDefaultExecutor = nullptr
 

Function Documentation

◆ num_cores()

static int num_cores ( )
static

Definition at line 29 of file SkExecutor.cpp.

29 {
30 return (int)sysconf(_SC_NPROCESSORS_ONLN);
31 }

◆ pop() [1/2]

static std::function< void(void)> pop ( std::deque< std::function< void(void)> > *  list)
inlinestatic

Definition at line 62 of file SkExecutor.cpp.

62 {
63 std::function<void(void)> fn = std::move(list->front());
64 list->pop_front();
65 return fn;
66}
Dart_NativeFunction function
Definition: fuchsia.cc:51

◆ pop() [2/2]

static std::function< void(void)> pop ( TArray< std::function< void(void)> > *  list)
inlinestatic

Definition at line 67 of file SkExecutor.cpp.

67 {
68 std::function<void(void)> fn = std::move(list->back());
69 list->pop_back();
70 return fn;
71}

◆ trivial_executor()

static SkExecutor & trivial_executor ( )
static

Definition at line 43 of file SkExecutor.cpp.

43 {
45 return *executor;
46}

Variable Documentation

◆ gDefaultExecutor

SkExecutor* gDefaultExecutor = nullptr
static

Definition at line 48 of file SkExecutor.cpp.