Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions shell/platform/embedder/tests/embedder_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3943,6 +3943,7 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
fml::CountDownLatch latch;

// Ensures that the expect number of distinct threads were serviced.
std::mutex thread_ids_mutex;
std::set<std::thread::id> thread_ids;

size_t platform_threads_count = 0;
Expand All @@ -3960,7 +3961,6 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
engine.get(),
[](FlutterNativeThreadType type, void* baton) {
auto captures = reinterpret_cast<Captures*>(baton);

switch (type) {
case kFlutterNativeThreadTypeRender:
captures->render_threads_count++;
Expand All @@ -3975,8 +3975,10 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
captures->platform_threads_count++;
break;
}

captures->thread_ids.insert(std::this_thread::get_id());
{
std::scoped_lock lock(captures->thread_ids_mutex);
captures->thread_ids.insert(std::this_thread::get_id());
}
captures->latch.CountDown();
},
&captures),
Expand Down