[Impeller] Fix a race in the ReactorGLES.PerThreadOperationQueues test (flutter/engine#57147)

Pass a flag to AddOperation to ensure that ReactorGLES does not immediately execute the operation on the second thread.
This commit is contained in:
Jason Simmons
2024-12-12 07:41:32 -08:00
committed by GitHub
parent 7915e978a7
commit feda309b66

View File

@@ -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());
});