Commit fe64e03
committed
Make Window.Invalidate() non-blocking with Monitor.TryEnter
Replace lock(_lock) with Monitor.TryEnter to prevent UI freezes
when background threads call Invalidate() while the render thread
holds the lock. If the lock is contended, the targeted node
invalidation is skipped but _invalidated and IsDirty flags are
still set, so the render loop does a full layout rebuild on the
next frame.1 parent 220cb57 commit fe64e03
1 file changed
Lines changed: 25 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1552 | 1552 | | |
1553 | 1553 | | |
1554 | 1554 | | |
1555 | | - | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1556 | 1559 | | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
| 1560 | + | |
1564 | 1561 | | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
| 1562 | + | |
1568 | 1563 | | |
1569 | | - | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
1570 | 1567 | | |
1571 | | - | |
| 1568 | + | |
1572 | 1569 | | |
1573 | | - | |
1574 | | - | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
1575 | 1581 | | |
1576 | 1582 | | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
1577 | 1587 | | |
1578 | 1588 | | |
1579 | 1589 | | |
| |||
0 commit comments