Flutter Engine
Loading...
Searching...
No Matches
post_task_sync.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
flutter/testing/post_task_sync.h
"
6
7
#include "
flutter/fml/synchronization/waitable_event.h
"
8
9
namespace
flutter::testing
{
10
11
void
PostTaskSync
(
const
fml::RefPtr<fml::TaskRunner>
& task_runner,
12
const
std::function<
void
()>& function) {
13
fml::AutoResetWaitableEvent
latch;
14
task_runner->PostTask([&] {
15
function
();
16
latch.
Signal
();
17
});
18
latch.
Wait
();
19
}
20
21
}
// namespace flutter::testing
fml::AutoResetWaitableEvent
Definition
waitable_event.h:28
fml::AutoResetWaitableEvent::Wait
void Wait()
Definition
waitable_event.cc:72
fml::AutoResetWaitableEvent::Signal
void Signal()
Definition
waitable_event.cc:61
fml::RefPtr
Definition
ref_ptr.h:65
function
Dart_NativeFunction function
Definition
fuchsia.cc:50
flutter::testing
Definition
native_assets_unittests.cc:10
flutter::testing::PostTaskSync
void PostTaskSync(const fml::RefPtr< fml::TaskRunner > &task_runner, const std::function< void()> &function)
Definition
post_task_sync.cc:11
post_task_sync.h
waitable_event.h
testing
post_task_sync.cc
Generated on Thu Nov 6 2025 16:11:29 for Flutter Engine by
1.9.8