Skip to content

Commit 176937c

Browse files
committed
fixed error in test
1 parent 8088e54 commit 176937c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libs/core/synchronization/include/hpx/synchronization/range_mutex.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace hpx::synchronization {
103103
std::error_code ec = std::make_error_code(
104104
std::errc::resource_deadlock_would_occur);
105105
throw std::system_error(
106-
ec, "unique_lock::lock: already locked");
106+
ec, "range_unique_lock::lock: already locked");
107107
}
108108
lock_id = mutex_ref.get().lock(begin, end);
109109
}
@@ -115,7 +115,7 @@ namespace hpx::synchronization {
115115
std::error_code ec = std::make_error_code(
116116
std::errc::resource_deadlock_would_occur);
117117
throw std::system_error(
118-
ec, "unique_lock::lock: already locked");
118+
ec, "range_unique_lock::lock: already locked");
119119
}
120120
lock_id = mutex_ref.get().try_lock(begin, end);
121121
}

libs/core/synchronization/tests/unit/range_mutex/range_mutex_util.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ namespace hpx::ranged_lock::test::util {
7676
NOTE : Critical Section should take care of obtaining the lock
7777
passed as first parameter
7878
*/
79-
template <typename Lock, typename RangeEndGen, typename CriticalSection>
79+
template <typename RangeMutex, typename RangeEndGen,
80+
typename CriticalSection>
8081
void test_lock_once(std::size_t const len, std::size_t const num_threads,
8182
std::size_t const num_incr_per_thread, RangeEndGen&& range_end_gen,
8283
CriticalSection&& critical_section)
@@ -88,7 +89,7 @@ namespace hpx::ranged_lock::test::util {
8889
get_increment_ranges(num_incr_per_thread * num_threads, len,
8990
std::forward<RangeEndGen>(range_end_gen));
9091

91-
Lock bl;
92+
RangeMutex rmtx;
9293

9394
for (std::size_t i = 0; i != num_threads; i++)
9495
{
@@ -99,18 +100,18 @@ namespace hpx::ranged_lock::test::util {
99100
increments.begin() + ((i + 1) * num_incr_per_thread);
100101

101102
threads.emplace_back(
102-
[&bl, &v, &critical_section, start_iter, end_iter]() {
103+
[&rmtx, &v, &critical_section, start_iter, end_iter]() {
103104
increments_ty::iterator it = start_iter;
104105
for (; it != end_iter; ++it)
105106
{
106107
std::size_t begin = it->first;
107108
std::size_t end = it->second;
108109

109-
std::size_t lockId = bl.lock(begin, end);
110+
std::size_t lockId = rmtx.lock(begin, end);
110111

111112
critical_section(v, begin, end);
112113

113-
bl.unlock(lockId);
114+
rmtx.unlock(lockId);
114115
}
115116
});
116117
}

0 commit comments

Comments
 (0)