From 30597b8f7dab56b3ea635c39266b2558b29223da Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 11 Dec 2024 23:48:15 +0000 Subject: [PATCH] [Impeller] Fix a race in the ReactorGLES.PerThreadOperationQueues test Pass a flag to AddOperation to ensure that ReactorGLES does not immediately execute the operation on the second thread. --- impeller/renderer/backend/gles/test/reactor_unittests.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impeller/renderer/backend/gles/test/reactor_unittests.cc b/impeller/renderer/backend/gles/test/reactor_unittests.cc index 48ee45dd3a3be..47c70ddcc4e9b 100644 --- a/impeller/renderer/backend/gles/test/reactor_unittests.cc +++ b/impeller/renderer/backend/gles/test/reactor_unittests.cc @@ -131,8 +131,8 @@ TEST(ReactorGLES, PerThreadOperationQueues) { fml::AutoResetWaitableEvent event; bool op2_called = false; std::thread thread([&] { - EXPECT_TRUE( - reactor->AddOperation([&](const ReactorGLES&) { op2_called = true; })); + EXPECT_TRUE(reactor->AddOperation( + [&](const ReactorGLES&) { op2_called = true; }, true)); event.Wait(); EXPECT_TRUE(reactor->React()); });