( root: FiberRoot, suspendedLanes: Lanes, spawnedLane: Lane, didAttemptEntireTree: boolean, )
| 844 | } |
| 845 | |
| 846 | export function markRootSuspended( |
| 847 | root: FiberRoot, |
| 848 | suspendedLanes: Lanes, |
| 849 | spawnedLane: Lane, |
| 850 | didAttemptEntireTree: boolean, |
| 851 | ) { |
| 852 | // TODO: Split this into separate functions for marking the root at the end of |
| 853 | // a render attempt versus suspending while the root is still in progress. |
| 854 | root.suspendedLanes |= suspendedLanes; |
| 855 | root.pingedLanes &= ~suspendedLanes; |
| 856 | |
| 857 | if (didAttemptEntireTree) { |
| 858 | // Mark these lanes as warm so we know there's nothing else to work on. |
| 859 | root.warmLanes |= suspendedLanes; |
| 860 | } else { |
| 861 | // Render unwound without attempting all the siblings. Do no mark the lanes |
| 862 | // as warm. This will cause a prewarm render to be scheduled. |
| 863 | } |
| 864 | |
| 865 | // The suspended lanes are no longer CPU-bound. Clear their expiration times. |
| 866 | const expirationTimes = root.expirationTimes; |
| 867 | let lanes = suspendedLanes; |
| 868 | while (lanes > 0) { |
| 869 | const index = pickArbitraryLaneIndex(lanes); |
| 870 | const lane = 1 << index; |
| 871 | |
| 872 | expirationTimes[index] = NoTimestamp; |
| 873 | |
| 874 | lanes &= ~lane; |
| 875 | } |
| 876 | |
| 877 | if (spawnedLane !== NoLane) { |
| 878 | markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | export function markRootPinged(root: FiberRoot, pingedLanes: Lanes) { |
| 883 | root.pingedLanes |= root.suspendedLanes & pingedLanes; |
no test coverage detected