Skip to content

Commit 0a69353

Browse files
authored
Revert "Fix flake by making thread ID tracking in CanPostTaskToAllNativeThreads thread safe. (flutter#16081)"
This reverts commit 27e0001.
1 parent 68b5dd4 commit 0a69353

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

shell/platform/embedder/tests/embedder_unittests.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,7 +3943,6 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
39433943
fml::CountDownLatch latch;
39443944

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

39493948
size_t platform_threads_count = 0;
@@ -3961,6 +3960,7 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
39613960
engine.get(),
39623961
[](FlutterNativeThreadType type, void* baton) {
39633962
auto captures = reinterpret_cast<Captures*>(baton);
3963+
39643964
switch (type) {
39653965
case kFlutterNativeThreadTypeRender:
39663966
captures->render_threads_count++;
@@ -3975,10 +3975,8 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
39753975
captures->platform_threads_count++;
39763976
break;
39773977
}
3978-
{
3979-
std::scoped_lock lock(captures->thread_ids_mutex);
3980-
captures->thread_ids.insert(std::this_thread::get_id());
3981-
}
3978+
3979+
captures->thread_ids.insert(std::this_thread::get_id());
39823980
captures->latch.CountDown();
39833981
},
39843982
&captures),

0 commit comments

Comments
 (0)