aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authortheuni <theuni-nospam@xbmc.org>2013-06-13 23:46:08 -0400
committertheuni <theuni-nospam@xbmc.org>2013-06-14 00:01:57 -0400
commite2654c8d280fbe77920960009f337d3f3c6772b6 (patch)
tree77a069fe99aae3f6e7c1af4c4af9b6138166233c /src/util.h
parentf2763d6d60f64447d24d6af806e25e8c684d3e3d (diff)
downloadbitcoin-e2654c8d280fbe77920960009f337d3f3c6772b6.tar.xz
fixed: don't use thread::sleep_for where it's known to be broken
Fixes #2690.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index ae33fb4ed4..9173b5bb58 100644
--- a/src/util.h
+++ b/src/util.h
@@ -105,7 +105,11 @@ T* alignup(T* p)
inline void MilliSleep(int64 n)
{
-#if BOOST_VERSION >= 105000
+// Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50
+// until fixed in 1.52. Use the deprecated sleep method for the broken case.
+// See: https://svn.boost.org/trac/boost/ticket/7238
+
+#if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
boost::this_thread::sleep_for(boost::chrono::milliseconds(n));
#else
boost::this_thread::sleep(boost::posix_time::milliseconds(n));