mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 15:35:50 +00:00
Remove boost_thread dependency (RIPD-216).
Fixes RIPD-216
This commit is contained in:
committed by
Tom Ritchford
parent
4b5fd95657
commit
7eaca149c1
@@ -297,7 +297,6 @@ def config_env(toolchain, variant, env):
|
||||
'boost_program_options',
|
||||
'boost_regex',
|
||||
'boost_system',
|
||||
'boost_thread'
|
||||
]
|
||||
# We prefer static libraries for boost
|
||||
if env.get('BOOST_ROOT'):
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
// REMOVE ASAP
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -157,10 +155,10 @@ public:
|
||||
//
|
||||
void run ()
|
||||
{
|
||||
// VFALCO TODO replace this with a beast Time object?
|
||||
//
|
||||
using clock_type = std::chrono::steady_clock;
|
||||
|
||||
// Initialize the clock to the current time.
|
||||
boost::posix_time::ptime t = boost::posix_time::microsec_clock::universal_time ();
|
||||
auto t = clock_type::now();
|
||||
|
||||
while (! threadShouldExit ())
|
||||
{
|
||||
@@ -222,17 +220,17 @@ public:
|
||||
getApp().getOPs ().reportFeeChange ();
|
||||
}
|
||||
|
||||
t += boost::posix_time::seconds (1);
|
||||
boost::posix_time::time_duration when = t - boost::posix_time::microsec_clock::universal_time ();
|
||||
t += std::chrono::seconds (1);
|
||||
auto const duration = t - clock_type::now();
|
||||
|
||||
if ((when.is_negative ()) || (when.total_seconds () > 1))
|
||||
if ((duration < std::chrono::seconds (0)) || (duration > std::chrono::seconds (1)))
|
||||
{
|
||||
m_journal.warning << "time jump";
|
||||
t = boost::posix_time::microsec_clock::universal_time ();
|
||||
t = clock_type::now();
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::this_thread::sleep (when);
|
||||
std::this_thread::sleep_for (duration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user