From 14e182e0cd62086eae4fecec279b93a3c5379897 Mon Sep 17 00:00:00 2001 From: Hari Hara Naveen S Date: Wed, 24 Jan 2024 01:07:40 -0600 Subject: [PATCH] sys erro trying to fix --- .../include/hpx/synchronization/range_mutex.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libs/core/synchronization/include/hpx/synchronization/range_mutex.hpp b/libs/core/synchronization/include/hpx/synchronization/range_mutex.hpp index eef1a102829..095bdd052d7 100644 --- a/libs/core/synchronization/include/hpx/synchronization/range_mutex.hpp +++ b/libs/core/synchronization/include/hpx/synchronization/range_mutex.hpp @@ -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); }