@@ -72,9 +72,9 @@ class shared_mutex {
7272 {
7373 PMEMobjpool *pop = pmemobj_pool_by_ptr (this );
7474 if (int ret = pmemobj_rwlock_wrlock (pop, &this ->plock ))
75- throw pmem:: lock_error(ret, std::system_category (),
76- " Failed to lock a shared mutex. " )
77- . with_pmemobj_errormsg ( );
75+ throw detail::exception_with_errormsg< lock_error>(
76+ ret, std::system_category (),
77+ " Failed to lock a shared mutex. " );
7878 }
7979
8080 /* *
@@ -97,7 +97,7 @@ class shared_mutex {
9797 {
9898 PMEMobjpool *pop = pmemobj_pool_by_ptr (this );
9999 if (int ret = pmemobj_rwlock_rdlock (pop, &this ->plock ))
100- throw pmem:: lock_error (
100+ throw detail::exception_with_errormsg< lock_error> (
101101 ret, std::system_category (),
102102 " Failed to shared lock a shared mutex." );
103103 }
@@ -127,9 +127,9 @@ class shared_mutex {
127127 else if (ret == EBUSY)
128128 return false ;
129129 else
130- throw pmem:: lock_error(ret, std::system_category (),
131- " Failed to lock a shared mutex. " )
132- . with_pmemobj_errormsg ( );
130+ throw detail::exception_with_errormsg< lock_error>(
131+ ret, std::system_category (),
132+ " Failed to lock a shared mutex. " );
133133 }
134134
135135 /* *
@@ -159,9 +159,9 @@ class shared_mutex {
159159 else if (ret == EBUSY)
160160 return false ;
161161 else
162- throw pmem:: lock_error(ret, std::system_category (),
163- " Failed to lock a shared mutex. " )
164- . with_pmemobj_errormsg ( );
162+ throw detail::exception_with_errormsg< lock_error>(
163+ ret, std::system_category (),
164+ " Failed to lock a shared mutex. " );
165165 }
166166
167167 /* *
@@ -176,10 +176,9 @@ class shared_mutex {
176176 PMEMobjpool *pop = pmemobj_pool_by_ptr (this );
177177 int ret = pmemobj_rwlock_unlock (pop, &this ->plock );
178178 if (ret)
179- throw pmem:: lock_error (
179+ throw detail::exception_with_errormsg< lock_error> (
180180 ret, std::system_category (),
181- " Failed to unlock a shared mutex." )
182- .with_pmemobj_errormsg ();
181+ " Failed to unlock a shared mutex." );
183182 }
184183
185184 /* *
0 commit comments