Skip to content

Commit 3522f49

Browse files
committed
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.
1 parent 07b770c commit 3522f49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/httpserver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,11 @@ void StopHTTPServer()
487487
// master that appears to be solved, so in the future that solution
488488
// could be used again (if desirable).
489489
// (see discussion in https://github.com/bitcoin/bitcoin/pull/6990)
490+
#if BOOST_VERSION >= 105000
490491
if (!threadHTTP.try_join_for(boost::chrono::milliseconds(2000))) {
492+
#else
493+
if (!threadHTTP.timed_join(boost::posix_time::milliseconds(2000))) {
494+
#endif
491495
LogPrintf("HTTP event loop did not exit within allotted time, sending loopbreak\n");
492496
event_base_loopbreak(eventBase);
493497
threadHTTP.join();

0 commit comments

Comments
 (0)