Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | List of all members
fml::ConcurrentTaskRunner Class Reference

#include <concurrent_message_loop.h>

Inheritance diagram for fml::ConcurrentTaskRunner:
fml::BasicTaskRunner

Public Member Functions

 ConcurrentTaskRunner (std::weak_ptr< ConcurrentMessageLoop > weak_loop)
 
virtual ~ConcurrentTaskRunner ()
 
void PostTask (const fml::closure &task) override
 
virtual void PostTask (const fml::closure &task)=0
 

Detailed Description

Definition at line 66 of file concurrent_message_loop.h.

Constructor & Destructor Documentation

◆ ConcurrentTaskRunner()

fml::ConcurrentTaskRunner::ConcurrentTaskRunner ( std::weak_ptr< ConcurrentMessageLoop weak_loop)
explicit

Definition at line 150 of file concurrent_message_loop.cc.

152 : weak_loop_(std::move(weak_loop)) {}

◆ ~ConcurrentTaskRunner()

fml::ConcurrentTaskRunner::~ConcurrentTaskRunner ( )
virtualdefault

Member Function Documentation

◆ PostTask()

void fml::ConcurrentTaskRunner::PostTask ( const fml::closure task)
overridevirtual

Schedules task to be executed on the TaskRunner's associated event loop.

Implements fml::BasicTaskRunner.

Definition at line 156 of file concurrent_message_loop.cc.

156 {
157 if (!task) {
158 return;
159 }
160
161 if (auto loop = weak_loop_.lock()) {
162 loop->PostTask(task);
163 return;
164 }
165
166 FML_DLOG(WARNING)
167 << "Tried to post to a concurrent message loop that has already died. "
168 "Executing the task on the callers thread.";
169 task();
170}
#define FML_DLOG(severity)
Definition: logging.h:102

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