mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This test worked by 1) releasing an item to be destructed on a background thead 2) adding a second item to this queue with a waitable event. The idea being you could wait for the event and that would tell you when 1) was complete. Unfortunately these items are released by being placed into a std::vector, which destroyed in _reverse_ order. Somtimes when the test state was queried the work was done and sometimes it wasn't To fix this, add a second waitable event that guarantees that both the first event and the original event have finished - because we do not add these event until the first is destructed and we do not add items to the destroy list while it is in progress.