This is an archive of the discontinued LLVM Phabricator instance.

Avoid hidden <climits> dependency in <thread>
AbandonedPublic

Authored by joerg on May 27 2020, 5:26 PM.

Details

Reviewers
mclow.lists
Summary

sleep_for tries to convert arbitrary durations toward nanosecond resolution in a way that avoids truncation. The nanosecond timer is declared using long long, but the minimum required size of 64bit signed is enough for all computation needs. Avoid doing a long double constexpr computation here as older GCC versions on PowerPC have problems folding the double-double type and also avoid the additional header include at the same time. The constant equals about 290 years and should be good enough.

Diff Detail

Event Timeline

joerg created this revision.May 27 2020, 5:26 PM
joerg abandoned this revision.Feb 18 2021, 6:21 AM