File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
shell/platform/embedder/tests Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -3943,6 +3943,7 @@ 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;
39463947 std::set<std::thread::id> thread_ids;
39473948
39483949 size_t platform_threads_count = 0 ;
@@ -3960,7 +3961,6 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
39603961 engine.get (),
39613962 [](FlutterNativeThreadType type, void * baton) {
39623963 auto captures = reinterpret_cast <Captures*>(baton);
3963-
39643964 switch (type) {
39653965 case kFlutterNativeThreadTypeRender :
39663966 captures->render_threads_count ++;
@@ -3975,8 +3975,10 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
39753975 captures->platform_threads_count ++;
39763976 break ;
39773977 }
3978-
3979- captures->thread_ids .insert (std::this_thread::get_id ());
3978+ {
3979+ std::scoped_lock lock (captures->thread_ids_mutex );
3980+ captures->thread_ids .insert (std::this_thread::get_id ());
3981+ }
39803982 captures->latch .CountDown ();
39813983 },
39823984 &captures),
You can’t perform that action at this time.
0 commit comments