From 8cace3f05003c6cb4d38c36890055f03151c2ad4 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 16 Oct 2026 02:39:56 +0800 Subject: Remove old code Signed-off-by: Richard Qin --- .../libcxx/include/c++/v1/__mutex/lock_guard.h | 46 ------ third_party/libcxx/include/c++/v1/__mutex/mutex.h | 53 ------- .../libcxx/include/c++/v1/__mutex/once_flag.h | 163 ------------------- .../libcxx/include/c++/v1/__mutex/tag_types.h | 44 ------ .../libcxx/include/c++/v1/__mutex/unique_lock.h | 174 --------------------- 5 files changed, 480 deletions(-) delete mode 100644 third_party/libcxx/include/c++/v1/__mutex/lock_guard.h delete mode 100644 third_party/libcxx/include/c++/v1/__mutex/mutex.h delete mode 100644 third_party/libcxx/include/c++/v1/__mutex/once_flag.h delete mode 100644 third_party/libcxx/include/c++/v1/__mutex/tag_types.h delete mode 100644 third_party/libcxx/include/c++/v1/__mutex/unique_lock.h (limited to 'third_party/libcxx/include/c++/v1/__mutex') diff --git a/third_party/libcxx/include/c++/v1/__mutex/lock_guard.h b/third_party/libcxx/include/c++/v1/__mutex/lock_guard.h deleted file mode 100644 index 67a25ed..0000000 --- a/third_party/libcxx/include/c++/v1/__mutex/lock_guard.h +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___MUTEX_LOCK_GUARD_H -#define _LIBCPP___MUTEX_LOCK_GUARD_H - -#include <__config> -#include <__mutex/tag_types.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -template -class _LIBCPP_SCOPED_LOCKABLE lock_guard { -public: - typedef _Mutex mutex_type; - -private: - mutex_type& __m_; - -public: - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI explicit lock_guard(mutex_type& __m) _LIBCPP_ACQUIRE_CAPABILITY(__m) - : __m_(__m) { - __m_.lock(); - } - - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_REQUIRES_CAPABILITY(__m) - : __m_(__m) {} - _LIBCPP_RELEASE_CAPABILITY _LIBCPP_HIDE_FROM_ABI ~lock_guard() { __m_.unlock(); } - - lock_guard(lock_guard const&) = delete; - lock_guard& operator=(lock_guard const&) = delete; -}; -_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(lock_guard); - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___MUTEX_LOCK_GUARD_H diff --git a/third_party/libcxx/include/c++/v1/__mutex/mutex.h b/third_party/libcxx/include/c++/v1/__mutex/mutex.h deleted file mode 100644 index e9cedf8..0000000 --- a/third_party/libcxx/include/c++/v1/__mutex/mutex.h +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___MUTEX_MUTEX_H -#define _LIBCPP___MUTEX_MUTEX_H - -#include <__config> -#include <__thread/support.h> -#include <__type_traits/is_nothrow_constructible.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_HAS_THREADS - -_LIBCPP_BEGIN_NAMESPACE_STD - -class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_CAPABILITY("mutex") mutex { - __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER; - -public: - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR mutex() = default; - - mutex(const mutex&) = delete; - mutex& operator=(const mutex&) = delete; - -# if _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION - _LIBCPP_HIDE_FROM_ABI ~mutex() = default; -# else - ~mutex() _NOEXCEPT; -# endif - - _LIBCPP_ACQUIRE_CAPABILITY() void lock(); - [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock() _NOEXCEPT; - _LIBCPP_RELEASE_CAPABILITY void unlock() _NOEXCEPT; - - typedef __libcpp_mutex_t* native_handle_type; - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; } -}; - -static_assert(is_nothrow_default_constructible::value, "the default constructor for std::mutex must be nothrow"); - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_HAS_THREADS - -#endif // _LIBCPP___MUTEX_MUTEX_H diff --git a/third_party/libcxx/include/c++/v1/__mutex/once_flag.h b/third_party/libcxx/include/c++/v1/__mutex/once_flag.h deleted file mode 100644 index ad15b2e..0000000 --- a/third_party/libcxx/include/c++/v1/__mutex/once_flag.h +++ /dev/null @@ -1,163 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___MUTEX_ONCE_FLAG_H -#define _LIBCPP___MUTEX_ONCE_FLAG_H - -#include <__config> -#include <__memory/addressof.h> -#include <__tuple/tuple_size.h> -#include <__type_traits/invoke.h> -#include <__utility/forward.h> -#include <__utility/integer_sequence.h> -#include <__utility/move.h> -#include -#ifndef _LIBCPP_CXX03_LANG -# include -#endif - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -struct once_flag; - -#ifndef _LIBCPP_CXX03_LANG - -template -_LIBCPP_HIDE_FROM_ABI void call_once(once_flag&, _Callable&&, _Args&&...); - -#else // _LIBCPP_CXX03_LANG - -template -_LIBCPP_HIDE_FROM_ABI void call_once(once_flag&, _Callable&); - -template -_LIBCPP_HIDE_FROM_ABI void call_once(once_flag&, const _Callable&); - -#endif // _LIBCPP_CXX03_LANG - -struct once_flag { - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR once_flag() _NOEXCEPT : __state_(_Unset) {} - once_flag(const once_flag&) = delete; - once_flag& operator=(const once_flag&) = delete; - -#if defined(_LIBCPP_ABI_MICROSOFT) - typedef uintptr_t _State_type; -#else - typedef unsigned long _State_type; -#endif - - static const _State_type _Unset = 0; - static const _State_type _Pending = 1; - static const _State_type _Complete = ~_State_type(0); - -private: - _State_type __state_; - -#ifndef _LIBCPP_CXX03_LANG - template - friend void call_once(once_flag&, _Callable&&, _Args&&...); -#else // _LIBCPP_CXX03_LANG - template - friend void call_once(once_flag&, _Callable&); - - template - friend void call_once(once_flag&, const _Callable&); -#endif // _LIBCPP_CXX03_LANG -}; - -#ifndef _LIBCPP_CXX03_LANG - -template -class __call_once_param { - _Fp& __f_; - -public: - _LIBCPP_HIDE_FROM_ABI explicit __call_once_param(_Fp& __f) : __f_(__f) {} - - _LIBCPP_HIDE_FROM_ABI void operator()() { - [&](__index_sequence<_Indices...>) -> void { - std::__invoke(std::get<_Indices>(std::move(__f_))...); - }(__make_index_sequence::value>()); - } -}; - -#else - -template -class __call_once_param { - _Fp& __f_; - -public: - _LIBCPP_HIDE_FROM_ABI explicit __call_once_param(_Fp& __f) : __f_(__f) {} - - _LIBCPP_HIDE_FROM_ABI void operator()() { __f_(); } -}; - -#endif - -template -void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) { - __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp); - (*__p)(); -} - -_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*)); - -template -inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) { -#if _LIBCPP_HAS_THREADS - return __atomic_load_n(__value, __ATOMIC_ACQUIRE); -#else - return *__value; -#endif -} - -#ifndef _LIBCPP_CXX03_LANG - -template -inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) { - if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) { - typedef tuple<_Callable&&, _Args&&...> _Gp; - _Gp __f(std::forward<_Callable>(__func), std::forward<_Args>(__args)...); - __call_once_param<_Gp> __p(__f); - std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy<_Gp>)); - } -} - -#else // _LIBCPP_CXX03_LANG - -template -inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable& __func) { - if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) { - __call_once_param<_Callable> __p(__func); - std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy<_Callable>)); - } -} - -template -inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, const _Callable& __func) { - if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) { - __call_once_param __p(__func); - std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy)); - } -} - -#endif // _LIBCPP_CXX03_LANG - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___MUTEX_ONCE_FLAG_H diff --git a/third_party/libcxx/include/c++/v1/__mutex/tag_types.h b/third_party/libcxx/include/c++/v1/__mutex/tag_types.h deleted file mode 100644 index 36b1a3d..0000000 --- a/third_party/libcxx/include/c++/v1/__mutex/tag_types.h +++ /dev/null @@ -1,44 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___MUTEX_TAG_TYPES_H -#define _LIBCPP___MUTEX_TAG_TYPES_H - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -struct defer_lock_t { - explicit defer_lock_t() = default; -}; - -struct try_to_lock_t { - explicit try_to_lock_t() = default; -}; - -struct adopt_lock_t { - explicit adopt_lock_t() = default; -}; - -#if _LIBCPP_STD_VER >= 17 -inline constexpr defer_lock_t defer_lock = defer_lock_t(); -inline constexpr try_to_lock_t try_to_lock = try_to_lock_t(); -inline constexpr adopt_lock_t adopt_lock = adopt_lock_t(); -#elif !defined(_LIBCPP_CXX03_LANG) -constexpr defer_lock_t defer_lock = defer_lock_t(); -constexpr try_to_lock_t try_to_lock = try_to_lock_t(); -constexpr adopt_lock_t adopt_lock = adopt_lock_t(); -#endif - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___MUTEX_TAG_TYPES_H diff --git a/third_party/libcxx/include/c++/v1/__mutex/unique_lock.h b/third_party/libcxx/include/c++/v1/__mutex/unique_lock.h deleted file mode 100644 index 6968922..0000000 --- a/third_party/libcxx/include/c++/v1/__mutex/unique_lock.h +++ /dev/null @@ -1,174 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___MUTEX_UNIQUE_LOCK_H -#define _LIBCPP___MUTEX_UNIQUE_LOCK_H - -#include <__chrono/duration.h> -#include <__chrono/time_point.h> -#include <__config> -#include <__memory/addressof.h> -#include <__mutex/tag_types.h> -#include <__system_error/throw_system_error.h> -#include <__utility/move.h> -#include <__utility/swap.h> -#include - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template -class unique_lock { -public: - typedef _Mutex mutex_type; - -private: - mutex_type* __m_; - bool __owns_; - -public: - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI explicit unique_lock(mutex_type& __m) - : __m_(std::addressof(__m)), __owns_(true) { - __m_->lock(); - } - - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT - : __m_(std::addressof(__m)), - __owns_(false) {} - - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, try_to_lock_t) - : __m_(std::addressof(__m)), __owns_(__m.try_lock()) {} - - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, adopt_lock_t) - : __m_(std::addressof(__m)), __owns_(true) {} - - template - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t) - : __m_(std::addressof(__m)), __owns_(__m.try_lock_until(__t)) {} - - template - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d) - : __m_(std::addressof(__m)), __owns_(__m.try_lock_for(__d)) {} - - _LIBCPP_HIDE_FROM_ABI ~unique_lock() { - if (__owns_) - __m_->unlock(); - } - - unique_lock(unique_lock const&) = delete; - unique_lock& operator=(unique_lock const&) = delete; - - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI unique_lock(unique_lock&& __u) _NOEXCEPT - : __m_(__u.__m_), - __owns_(__u.__owns_) { - __u.__m_ = nullptr; - __u.__owns_ = false; - } - - _LIBCPP_HIDE_FROM_ABI unique_lock& operator=(unique_lock&& __u) _NOEXCEPT { - if (this != std::addressof(__u)) - unique_lock(std::move(__u)).swap(*this); - return *this; - } - - _LIBCPP_HIDE_FROM_ABI void lock(); - _LIBCPP_HIDE_FROM_ABI bool try_lock(); - - template - _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d); - - template - _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); - - _LIBCPP_HIDE_FROM_ABI void unlock(); - - _LIBCPP_HIDE_FROM_ABI void swap(unique_lock& __u) _NOEXCEPT { - std::swap(__m_, __u.__m_); - std::swap(__owns_, __u.__owns_); - } - - _LIBCPP_HIDE_FROM_ABI mutex_type* release() _NOEXCEPT { - mutex_type* __m = __m_; - __m_ = nullptr; - __owns_ = false; - return __m; - } - - _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; } - _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; } - _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; } -}; -_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock); - -template -_LIBCPP_HIDE_FROM_ABI void unique_lock<_Mutex>::lock() { - if (__m_ == nullptr) - std::__throw_system_error(EPERM, "unique_lock::lock: references null mutex"); - if (__owns_) - std::__throw_system_error(EDEADLK, "unique_lock::lock: already locked"); - __m_->lock(); - __owns_ = true; -} - -template -_LIBCPP_HIDE_FROM_ABI bool unique_lock<_Mutex>::try_lock() { - if (__m_ == nullptr) - std::__throw_system_error(EPERM, "unique_lock::try_lock: references null mutex"); - if (__owns_) - std::__throw_system_error(EDEADLK, "unique_lock::try_lock: already locked"); - __owns_ = __m_->try_lock(); - return __owns_; -} - -template -template -_LIBCPP_HIDE_FROM_ABI bool unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d) { - if (__m_ == nullptr) - std::__throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex"); - if (__owns_) - std::__throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked"); - __owns_ = __m_->try_lock_for(__d); - return __owns_; -} - -template -template -_LIBCPP_HIDE_FROM_ABI bool unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) { - if (__m_ == nullptr) - std::__throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex"); - if (__owns_) - std::__throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked"); - __owns_ = __m_->try_lock_until(__t); - return __owns_; -} - -template -_LIBCPP_HIDE_FROM_ABI void unique_lock<_Mutex>::unlock() { - if (!__owns_) - std::__throw_system_error(EPERM, "unique_lock::unlock: not locked"); - __m_->unlock(); - __owns_ = false; -} - -template -inline _LIBCPP_HIDE_FROM_ABI void swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT { - __x.swap(__y); -} - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___MUTEX_UNIQUE_LOCK_H -- cgit v1.2.3