Commit 0ca0ef6
authored
[Windows] Fix EGL surface destruction race (flutter#51781)
This fixes the `WindowsTest.EngineCanTransitionToHeadless` flakiness reported by @matanlurey.
EGL surfaces can only be used by a single thread at a time. Concurrent operations are unsafe.
Previously, the EGL surface was destroyed on the platform thread. This was safe as this always happened after the engine was shutdown and the raster thread was stopped. However, in a multi-view world a view can be destroyed while the engine is running. There may be pending raster tasks that operate on the render surface. Thus, the EGL surfaces should be destroyed on the raster thread when it is available.
This bug was introduced by flutter/engine#51681
Part of flutter#142845
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style1 parent 8ec35b6 commit 0ca0ef6
3 files changed
Lines changed: 66 additions & 10 deletions
File tree
- shell/platform/windows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
| |||
105 | 123 | | |
106 | 124 | | |
107 | 125 | | |
108 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
109 | 129 | | |
110 | 130 | | |
111 | 131 | | |
| |||
706 | 726 | | |
707 | 727 | | |
708 | 728 | | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | 729 | | |
716 | 730 | | |
717 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
| |||
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
| 834 | + | |
828 | 835 | | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
829 | 842 | | |
830 | 843 | | |
831 | 844 | | |
| |||
883 | 896 | | |
884 | 897 | | |
885 | 898 | | |
| 899 | + | |
886 | 900 | | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
887 | 907 | | |
888 | 908 | | |
889 | 909 | | |
| |||
940 | 960 | | |
941 | 961 | | |
942 | 962 | | |
| 963 | + | |
943 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
944 | 971 | | |
945 | 972 | | |
946 | 973 | | |
| |||
980 | 1007 | | |
981 | 1008 | | |
982 | 1009 | | |
| 1010 | + | |
983 | 1011 | | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
984 | 1018 | | |
985 | 1019 | | |
986 | 1020 | | |
| |||
1477 | 1511 | | |
1478 | 1512 | | |
1479 | 1513 | | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
1480 | 1519 | | |
1481 | 1520 | | |
1482 | 1521 | | |
| |||
1519 | 1558 | | |
1520 | 1559 | | |
1521 | 1560 | | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
1522 | 1567 | | |
1523 | 1568 | | |
1524 | 1569 | | |
| |||
0 commit comments