aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authortheuni <theuni-nospam@xbmc.org>2013-06-13 23:46:08 -0400
committerGavin Andresen <gavinandresen@gmail.com>2013-08-21 08:49:00 +1000
commit5e18c6ccbcf98e242d534b8ef3f166e079ad3c99 (patch)
tree471cafbfa5009526fa3e71587f1ce9ca0e457dd5 /src/util.h
parent708c75c0eeafb6363936233e6042e9227038c39f (diff)
downloadbitcoin-5e18c6ccbcf98e242d534b8ef3f166e079ad3c99.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 4ff128bb42..33832261e1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -107,7 +107,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));