Skip to content

Commit 988d27e

Browse files
Fixed shared_mutex for work with clang (#1100)
Clang doesn't provide __addressof, instead using addressof Relates-To: OAM-756 Signed-off-by: Andrey Kashcheev <[email protected]>
1 parent 3d524af commit 988d27e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

olp-cpp-sdk-core/include/olp/core/porting/shared_mutex.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,29 +317,29 @@ class shared_lock {
317317
shared_lock() noexcept : _M_pm(nullptr), _M_owns(false) {}
318318

319319
explicit shared_lock(mutex_type& __m)
320-
: _M_pm(std::__addressof(__m)), _M_owns(true) {
320+
: _M_pm(std::addressof(__m)), _M_owns(true) {
321321
__m.lock_shared();
322322
}
323323

324324
shared_lock(mutex_type& __m, defer_lock_t) noexcept
325-
: _M_pm(std::__addressof(__m)), _M_owns(false) {}
325+
: _M_pm(std::addressof(__m)), _M_owns(false) {}
326326

327327
shared_lock(mutex_type& __m, try_to_lock_t)
328-
: _M_pm(std::__addressof(__m)), _M_owns(__m.try_lock_shared()) {}
328+
: _M_pm(std::addressof(__m)), _M_owns(__m.try_lock_shared()) {}
329329

330330
shared_lock(mutex_type& __m, adopt_lock_t)
331-
: _M_pm(std::__addressof(__m)), _M_owns(true) {}
331+
: _M_pm(std::addressof(__m)), _M_owns(true) {}
332332

333333
template <typename _Clock, typename _Duration>
334334
shared_lock(mutex_type& __m,
335335
const chrono::time_point<_Clock, _Duration>& __abs_time)
336-
: _M_pm(std::__addressof(__m)),
336+
: _M_pm(std::addressof(__m)),
337337
_M_owns(__m.try_lock_shared_until(__abs_time)) {}
338338

339339
template <typename _Rep, typename _Period>
340340
shared_lock(mutex_type& __m,
341341
const chrono::duration<_Rep, _Period>& __rel_time)
342-
: _M_pm(std::__addressof(__m)),
342+
: _M_pm(std::addressof(__m)),
343343
_M_owns(__m.try_lock_shared_for(__rel_time)) {}
344344

345345
~shared_lock() {

0 commit comments

Comments
 (0)