Skip to content

Commit 618ce78

Browse files
authored
[libc++][NFC] Simplify scoped_lock::__unlock_unpack a bit (#85517)
1 parent 74d1a40 commit 618ce78

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

libcxx/include/mutex

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -418,24 +418,6 @@ inline _LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&...
418418
std::__lock_first(0, __l0, __l1, __l2, __l3...);
419419
}
420420

421-
template <class _L0>
422-
inline _LIBCPP_HIDE_FROM_ABI void __unlock(_L0& __l0) {
423-
__l0.unlock();
424-
}
425-
426-
template <class _L0, class _L1>
427-
inline _LIBCPP_HIDE_FROM_ABI void __unlock(_L0& __l0, _L1& __l1) {
428-
__l0.unlock();
429-
__l1.unlock();
430-
}
431-
432-
template <class _L0, class _L1, class _L2, class... _L3>
433-
inline _LIBCPP_HIDE_FROM_ABI void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
434-
__l0.unlock();
435-
__l1.unlock();
436-
std::__unlock(__l2, __l3...);
437-
}
438-
439421
# endif // _LIBCPP_CXX03_LANG
440422

441423
# if _LIBCPP_STD_VER >= 17
@@ -498,7 +480,7 @@ public:
498480
private:
499481
template <size_t... _Indx>
500482
_LIBCPP_HIDE_FROM_ABI static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {
501-
std::__unlock(std::get<_Indx>(__mt)...);
483+
(std::get<_Indx>(__mt).unlock(), ...);
502484
}
503485

504486
_MutexTuple __t_;

0 commit comments

Comments
 (0)