-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
didTimeout
check from work loop
No longer need this, since we have starvation protection in userspace. This will also allow us to remove the concept from the Scheduler package, which is nice because `postTask` doesn't currently support it.
- Loading branch information
Showing
3 changed files
with
10 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -754,7 +754,7 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) { | |
|
||
// This is the entry point for every concurrent task, i.e. anything that | ||
// goes through Scheduler. | ||
function performConcurrentWorkOnRoot(root, didTimeout) { | ||
function performConcurrentWorkOnRoot(root) { | ||
// Since we know we're in a React event, we can clear the current | ||
// event time. The next update will compute a new event time. | ||
currentEventTime = NoTimestamp; | ||
|
@@ -794,19 +794,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { | |
return null; | ||
} | ||
|
||
// TODO: We only check `didTimeout` defensively, to account for a Scheduler | ||
// bug where `shouldYield` sometimes returns `true` even if `didTimeout` is | ||
// true, which leads to an infinite loop. Once the bug in Scheduler is | ||
// fixed, we can remove this, since we track expiration ourselves. | ||
if (didTimeout) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
acdlite
Author
Collaborator
|
||
// Something expired. Flush synchronously until there's no expired | ||
// work left. | ||
markRootExpired(root, lanes); | ||
// This will schedule a synchronous callback. | ||
ensureRootIsScheduled(root, now()); | ||
return null; | ||
} | ||
|
||
let exitStatus = renderRootConcurrent(root, lanes); | ||
|
||
if ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@acdlite do we have a different guard for this infinite loop?