Skip to content

Commit

Permalink
sys erro trying to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan511 committed Jan 24, 2024
1 parent 2ac50be commit 14e182e
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,24 @@ namespace hpx::synchronization {
void lock(std::size_t begin, std::size_t end)
{
if (lock_id != 0)
throw std::system_error(std::error_code(EDEADLK),
"unique_lock::lock: already locked");
{
std::error_code ec = std::make_error_code(
std::errc::resource_deadlock_would_occur);
throw std::system_error(
ec, "unique_lock::lock: already locked");
}
lock_id = mutex_ref.get().lock(begin, end);
}

void try_lock(std::size_t begin, std::size_t end)
{
if (lock_id != 0)
throw std::system_error(std::error_code(EDEADLK),
"unique_lock::lock: already locked");
{
std::error_code ec = std::make_error_code(
std::errc::resource_deadlock_would_occur);
throw std::system_error(
ec, "unique_lock::lock: already locked");
}
lock_id = mutex_ref.get().try_lock(begin, end);
}

Expand Down

0 comments on commit 14e182e

Please sign in to comment.