Skip to content

Commit

Permalink
refactor: remove straggling boost::mutex usage
Browse files Browse the repository at this point in the history
After the merge of bitcoin#18710, the linter is warning:
```bash
A new Boost dependency in the form of "boost/thread/mutex.hpp" appears to have been introduced:
src/sync.cpp:#include <boost/thread/mutex.hpp>
src/test/sync_tests.cpp:#include <boost/thread/mutex.hpp>

^---- failure generated from test/lint/lint-includes.sh
```

the interim bitcoin#19337 was merged, which introduced more `boost::mutex` usage.

Given we no longer use `boost::mutex`, just remove the double lock test
and remaining includes.
  • Loading branch information
fanquake authored and remyers committed Jan 26, 2021
1 parent 42d11c1 commit 3edbc4f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include <util/strencodings.h>
#include <util/threadnames.h>

#include <boost/thread/mutex.hpp>

#include <map>
#include <mutex>
#include <set>
Expand Down Expand Up @@ -224,7 +222,6 @@ template void EnterCritical(const char*, const char*, int, Mutex*, bool);
template void EnterCritical(const char*, const char*, int, RecursiveMutex*, bool);
template void EnterCritical(const char*, const char*, int, std::mutex*, bool);
template void EnterCritical(const char*, const char*, int, std::recursive_mutex*, bool);
template void EnterCritical(const char*, const char*, int, boost::mutex*, bool);

void CheckLastCritical(void* cs, std::string& lockname, const char* guardname, const char* file, int line)
{
Expand Down
6 changes: 0 additions & 6 deletions src/test/sync_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <test/util/setup_common.h>

#include <boost/test/unit_test.hpp>
#include <boost/thread/mutex.hpp>

#include <mutex>

Expand Down Expand Up @@ -110,11 +109,6 @@ BOOST_AUTO_TEST_CASE(double_lock_mutex)
TestDoubleLock<Mutex>(true /* should throw */);
}

BOOST_AUTO_TEST_CASE(double_lock_boost_mutex)
{
TestDoubleLock<boost::mutex>(true /* should throw */);
}

BOOST_AUTO_TEST_CASE(double_lock_recursive_mutex)
{
TestDoubleLock<RecursiveMutex>(false /* should not throw */);
Expand Down

0 comments on commit 3edbc4f

Please sign in to comment.