aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-11-20 10:14:21 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-11-20 10:14:21 +0100
commit3522f49f5ae74fe3ef310fad6fa7e09d65c9c1b8 (patch)
tree68e8633d2b91fa23aa813fca57b72ab9158e5bec /src/httpserver.cpp
parent07b770caf3f57efb5f495661b33eda642e21b785 (diff)
downloadbitcoin-3522f49f5ae74fe3ef310fad6fa7e09d65c9c1b8.tar.xz
http: add Boost 1.49 compatibility
`try_join_for` was introduced in Boost 1.50: http://www.boost.org/doc/libs/1_50_0/doc/html/thread/thread_management.html#thread.thread_management.thread.try_join_for 1.49 has `timed_join`, one can accomplish the same with: http://www.boost.org/doc/libs/1_49_0/doc/html/thread/thread_management.html#thread.thread_management.thread.timed_join However, `timed_join` was deprecated in 1.50. So a conditional is necessary. This solution was tested in #7031.
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 52f5675e85..91518d7c5f 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -487,7 +487,11 @@ void StopHTTPServer()
// master that appears to be solved, so in the future that solution
// could be used again (if desirable).
// (see discussion in https://github.com/bitcoin/bitcoin/pull/6990)
+#if BOOST_VERSION >= 105000
if (!threadHTTP.try_join_for(boost::chrono::milliseconds(2000))) {
+#else
+ if (!threadHTTP.timed_join(boost::posix_time::milliseconds(2000))) {
+#endif
LogPrintf("HTTP event loop did not exit within allotted time, sending loopbreak\n");
event_base_loopbreak(eventBase);
threadHTTP.join();