cleanup: remove unneccesary boost dependencies from sync.cpp

Removes boost dependencies in sync.cpp in favor of standard c++
for-loops, improving readability.
This commit is contained in:
Patrick Lodder 2023-08-11 06:46:28 -04:00
parent 06e4040717
commit a9129315f5
No known key found for this signature in database
GPG Key ID: 7C523F5FBABE80E7

View File

@ -9,8 +9,6 @@
#include <stdio.h> #include <stdio.h>
#include <boost/foreach.hpp>
#include <boost/thread.hpp>
#include <thread> #include <thread>
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
@ -86,7 +84,7 @@ static void potential_deadlock_detected(const LockPair& mismatch, const LockStac
{ {
LogPrintf("POTENTIAL DEADLOCK DETECTED\n"); LogPrintf("POTENTIAL DEADLOCK DETECTED\n");
LogPrintf("Previous lock order was:\n"); LogPrintf("Previous lock order was:\n");
BOOST_FOREACH (const LockStackItem& i, s2) { for (const LockStackItem& i : s2) {
if (i.first == mismatch.first) { if (i.first == mismatch.first) {
LogPrintf(" (1)"); LogPrintf(" (1)");
} }
@ -96,7 +94,7 @@ static void potential_deadlock_detected(const LockPair& mismatch, const LockStac
LogPrintf(" %s\n", i.second.ToString()); LogPrintf(" %s\n", i.second.ToString());
} }
LogPrintf("Current lock order is:\n"); LogPrintf("Current lock order is:\n");
BOOST_FOREACH (const LockStackItem& i, s1) { for (const LockStackItem& i : s1) {
if (i.first == mismatch.first) { if (i.first == mismatch.first) {
LogPrintf(" (1)"); LogPrintf(" (1)");
} }
@ -116,7 +114,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
LockStack& lock_stack = lockdata.m_lock_stacks[std::this_thread::get_id()]; LockStack& lock_stack = lockdata.m_lock_stacks[std::this_thread::get_id()];
lock_stack.emplace_back(c, locklocation); lock_stack.emplace_back(c, locklocation);
BOOST_FOREACH (const LockStackItem& i, lock_stack) { for (const LockStackItem& i : lock_stack) {
if (i.first == c) if (i.first == c)
break; break;