Skip to content

Commit

Permalink
changed name to RangeLock
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan511 committed Nov 1, 2023
1 parent 486a0be commit 94ad707
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace hpx::synchronization {

template <typename Lock, template <typename> typename Guard>
class ByteLock
class RangeLock
{
template <typename Key, typename Value>
using MapTy = boost::container::flat_map<Key, Value>;
Expand All @@ -28,7 +28,7 @@ namespace hpx::synchronization {
};

template <class Lock, template <class> class Guard>
std::size_t ByteLock<Lock, Guard>::lock(std::size_t begin, std::size_t end)
std::size_t RangeLock<Lock, Guard>::lock(std::size_t begin, std::size_t end)
{
std::size_t lockId = 0;
bool localFlag = false;
Expand Down Expand Up @@ -71,7 +71,7 @@ namespace hpx::synchronization {
}

template <class Lock, template <class> class Guard>
void ByteLock<Lock, Guard>::unlock(std::size_t lockId)
void RangeLock<Lock, Guard>::unlock(std::size_t lockId)
{
const Guard lock_guard(mtx);

Expand All @@ -84,7 +84,7 @@ namespace hpx::synchronization {
}

template <class Lock, template <class> class Guard>
std::size_t ByteLock<Lock, Guard>::try_lock(
std::size_t RangeLock<Lock, Guard>::try_lock(
std::size_t begin, std::size_t end)
{
const Guard lock_guard(mtx);
Expand Down
6 changes: 3 additions & 3 deletions libs/core/synchronization/tests/unit/range_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

int main()
{
hpx::synchronization::ByteLock<hpx::mutex, std::lock_guard> bl;
std::size_t x = bl.lock(0, 10);
bl.unlock(x);
hpx::synchronization::RangeLock<hpx::mutex, std::lock_guard> rl;
std::size_t x = rl.lock(0, 10);
rl.unlock(x);
}

0 comments on commit 94ad707

Please sign in to comment.