diff options
| author | Luke Dashjr <[email protected]> | 2012-03-11 22:21:06 -0400 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2012-03-11 22:21:06 -0400 |
| commit | d05c03ab4ed23389b1326f9b7c77a8d7b8d6588d (patch) | |
| tree | c402523f1548781a1437a1e409b0ca8c7ae7ebf4 /src/util.h | |
| parent | Merge branch '0.5.0.x' into 0.5.x (diff) | |
| parent | Merge branch '0.4.x' into 0.5.0.x (diff) | |
| download | archived-discoin-0.5.3.tar.xz archived-discoin-0.5.3.zip | |
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h index 15a45ba7d..45b14420f 100644 --- a/src/util.h +++ b/src/util.h @@ -115,7 +115,9 @@ typedef u_int SOCKET; #define Beep(n1,n2) (0) inline void Sleep(int64 n) { - boost::thread::sleep(boost::get_system_time() + boost::posix_time::milliseconds(n)); + /*Boost has a year 2038 problem— if the request sleep time is past epoch+2^31 seconds the sleep returns instantly. + So we clamp our sleeps here to 10 years and hope that boost is fixed by 2028.*/ + boost::thread::sleep(boost::get_system_time() + boost::posix_time::milliseconds(n>315576000000LL?315576000000LL:n)); } #endif |