mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
74608417df
Summary: Changelog: [internal] If task that is being executed schedules a new task with higher priority, the new task will be dropped from the queue. To fix this, we always check if the top of the queue is what was executed and only then remove it. Example: Let's say there is task A with priority "normal". When we execute task A (which is not removed from the queue until later), it adds a task B with "immediate" priority. So priority queue now has two tasks: [1: B, 2: A] After task A finishes, inside workLoop, it will pop from top of the priority queue. But task A is no longer top of the priority queue (this is the bug) and it pops B. B is never executed and A is executed twice. Reviewed By: ShikaSD Differential Revision: D29841433 fbshipit-source-id: b2f1474fdfc7b3e2d42bae5b7f4ac7e6c3a37b54