comparison libcxx/src/shared_mutex.cpp @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children 1f2b6ac9f198
comparison
equal deleted inserted replaced
232:70dce7da266c 236:c4bab56944e8
1 //===---------------------- shared_mutex.cpp ------------------------------===// 1 //===----------------------------------------------------------------------===//
2 // 2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information. 4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // 6 //
7 //===----------------------------------------------------------------------===// 7 //===----------------------------------------------------------------------===//
8 8
9 #include "__config" 9 #include <__config>
10
10 #ifndef _LIBCPP_HAS_NO_THREADS 11 #ifndef _LIBCPP_HAS_NO_THREADS
11 12
12 #include "shared_mutex" 13 #include <shared_mutex>
13 #if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB) 14 #if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
14 #pragma comment(lib, "pthread") 15 # pragma comment(lib, "pthread")
15 #endif 16 #endif
16 17
17 _LIBCPP_BEGIN_NAMESPACE_STD 18 _LIBCPP_BEGIN_NAMESPACE_STD
18 19
19 // Shared Mutex Base 20 // Shared Mutex Base
103 } 104 }
104 105
105 106
106 // Shared Timed Mutex 107 // Shared Timed Mutex
107 // These routines are here for ABI stability 108 // These routines are here for ABI stability
108 shared_timed_mutex::shared_timed_mutex() : __base() {} 109 shared_timed_mutex::shared_timed_mutex() : __base_() {}
109 void shared_timed_mutex::lock() { return __base.lock(); } 110 void shared_timed_mutex::lock() { return __base_.lock(); }
110 bool shared_timed_mutex::try_lock() { return __base.try_lock(); } 111 bool shared_timed_mutex::try_lock() { return __base_.try_lock(); }
111 void shared_timed_mutex::unlock() { return __base.unlock(); } 112 void shared_timed_mutex::unlock() { return __base_.unlock(); }
112 void shared_timed_mutex::lock_shared() { return __base.lock_shared(); } 113 void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); }
113 bool shared_timed_mutex::try_lock_shared() { return __base.try_lock_shared(); } 114 bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }
114 void shared_timed_mutex::unlock_shared() { return __base.unlock_shared(); } 115 void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }
115 116
116 _LIBCPP_END_NAMESPACE_STD 117 _LIBCPP_END_NAMESPACE_STD
117 118
118 #endif // !_LIBCPP_HAS_NO_THREADS 119 #endif // !_LIBCPP_HAS_NO_THREADS