summarylogtreecommitdiffstats
path: root/boost.patch
blob: ad58e32a632f060e08d0cdf3dc822e40abf4f2e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
index a90ee449f029..18f2612dfd72 100644
--- a/bitcoin-qt.pro
+++ b/bitcoin-qt.pro
@@ -8,6 +8,7 @@ greaterThan(QT_MAJOR_VERSION, 4):QT+=widgets
 DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE HAVE_WORKING_BOOST_SLEEP_FOR
 CONFIG += no_include_pwd
 CONFIG += thread
+CONFIG += c++11
 
 # for boost 1.37, add -mt to the boost libraries
 # use: qmake BOOST_LIB_SUFFIX=-mt
diff --git a/src/util.h b/src/util.h
index 3599d0e66fe6..cf3dc0eadb12 100644
--- a/src/util.h
+++ b/src/util.h
@@ -24,6 +24,8 @@ typedef int pid_t; /* define for Windows compatibility */
 #include <utility>
 #include <vector>
 #include <string>
+#include <chrono>
+#include <thread>
 
 #include <boost/version.hpp>
 #include <boost/thread.hpp>
@@ -109,17 +111,7 @@ T* alignup(T* p)
 
 inline void MilliSleep(int64 n)
 {
-// 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 defined(HAVE_WORKING_BOOST_SLEEP_FOR)
-    boost::this_thread::sleep_for(boost::chrono::milliseconds(n));
-#elif defined(HAVE_WORKING_BOOST_SLEEP)
-    boost::this_thread::sleep(boost::posix_time::milliseconds(n));
-#else
-  //should never get here
-#error missing boost sleep implementation
-#endif
+    std::this_thread::sleep_for(std::chrono::milliseconds(n));
 }
 
 #ifndef THROW_WITH_STACKTRACE