Skip to content

Commit

Permalink
Merge pull request #425 from evoskuil/master
Browse files Browse the repository at this point in the history
Eliminate boost::thread dependency.
  • Loading branch information
evoskuil committed Mar 17, 2024
2 parents ff48e46 + 34c2465 commit 817a3f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/bitcoin/database/primitives/head.hpp
Expand Up @@ -20,8 +20,8 @@
#define LIBBITCOIN_DATABASE_PRIMITIVES_HEAD_HPP

#include <algorithm>
#include <shared_mutex>
#include <bitcoin/system.hpp>
#include <bitcoin/database/boost.hpp>
#include <bitcoin/database/define.hpp>
#include <bitcoin/database/memory/memory.hpp>

Expand Down Expand Up @@ -96,7 +96,7 @@ class head

storage& file_;
const Link buckets_;
mutable boost::upgrade_mutex mutex_;
mutable std::shared_mutex mutex_;
};

} // namespace database
Expand Down
13 changes: 2 additions & 11 deletions test/memory/accessor.cpp
Expand Up @@ -31,19 +31,10 @@ BOOST_AUTO_TEST_CASE(accessor__construct_shared_mutex__unassigned__nulls)
BOOST_REQUIRE(is_null(instance.end()));
}

BOOST_AUTO_TEST_CASE(accessor__construct_upgrade_mutex__unassigned__nulls)
{
boost::upgrade_mutex mutex;
accessor instance(mutex);
BOOST_REQUIRE(is_null(instance.data()));
BOOST_REQUIRE(is_null(instance.begin()));
BOOST_REQUIRE(is_null(instance.end()));
}

BOOST_AUTO_TEST_CASE(accessor__destruct__shared_lock__released)
{
boost::upgrade_mutex mutex;
auto access = std::make_shared<accessor<boost::upgrade_mutex>>(mutex);
std::shared_mutex mutex;
auto access = std::make_shared<accessor<std::shared_mutex>>(mutex);
BOOST_REQUIRE(!mutex.try_lock());
access.reset();
BOOST_REQUIRE(mutex.try_lock());
Expand Down

0 comments on commit 817a3f6

Please sign in to comment.