message: Remove Boost dependency from sync.cpp
  use c++11 for loops instead of BOOST_FOREACH
diff: #include <stdio.h>
  -#include <boost/foreach.hpp>
  -
  #ifdef DEBUG_LOCKCONTENTION
  #if !defined(HAVE_THREAD_LOCAL)
  static_assert(false, "thread_local is not supported");
  @@ -84,7 +82,7 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch,
  {
  LogPrintf("POTENTIAL DEADLOCK DETECTED\n");
  LogPrintf("Previous lock order was:\n");
  - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, s2) {
  + for (const std::pair<void*, CLockLocation>& i : s2) {
  if (i.first == mismatch.first) {
  LogPrintf(" (1)");
  }
  @@ -94,7 +92,7 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch,
  LogPrintf(" %s\n", i.second.ToString());
  }
  LogPrintf("Current lock order is:\n");
  - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, s1) {
  + for (const std::pair<void*, CLockLocation>& i : s1) {
  if (i.first == mismatch.first) {
  LogPrintf(" (1)");
  }
  @@ -114,7 +112,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
  lockstack->push_back(std::make_pair(c, locklocation));
  - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, (*lockstack)) {
  + for (const std::pair<void*, CLockLocation>& i : (*lockstack)) {
  if (i.first == c)
  break;
  @@ -148,14 +146,14 @@ void LeaveCritical()
  std::string LocksHeld()
  {
  std::string result;
  - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, *lockstack)
  + for (const std::pair<void*, CLockLocation>& i : *lockstack)
  result += i.second.ToString() + std::string("\n");
  return result;
  }
  void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs)
  {
  - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, *lockstack)
  + for (const std::pair<void*, CLockLocation>& i : *lockstack)
  if (i.first == cs)
  return;
  fprintf(stderr, "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld().c_str());
  