Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix sleep() with huge values failing to sleep
Imagine you get into a cryogenic chamber, hoping to be whisked into the distant future exactly 317,097,919 years, 50 weeks, 2 days, 17 hours, 46 minutes, and 40 seconds in the future. The control software is written in Perl 6 and the lazy programmer just stuck a sleep() function in there. Unfortunately, you will be defrosted instantly, because there's a bug with such huge numbers and sleep() doesn't sleep at all! Of course, another lazy programmer may assume such huge amounts of time are practically infinity and fix the bug with such assumption, but then you will be frozen... forever! Therefore, we must fix the sleep() function to handle huge chunks of time by splitting them into several sleeps in intervals of 1e16 seconds (approximatelly max that JVM can handle), thereby guaranteeing all cryogenic chambers will function correctly. Fixes RT130170: #https://rt.perl.org/Ticket/Display.html?id=130170
- Loading branch information