@@ -229,7 +229,7 @@ public:
229229 recursive_mutex& operator =(const recursive_mutex&) = delete ;
230230
231231 void lock ();
232- bool try_lock () _NOEXCEPT;
232+ [[__nodiscard__]] bool try_lock () _NOEXCEPT;
233233 void unlock () _NOEXCEPT;
234234
235235 typedef __libcpp_recursive_mutex_t * native_handle_type;
@@ -251,14 +251,14 @@ public:
251251
252252public:
253253 void lock ();
254- bool try_lock () _NOEXCEPT;
254+ [[__nodiscard__]] bool try_lock () _NOEXCEPT;
255255 template <class _Rep , class _Period >
256- _LIBCPP_HIDE_FROM_ABI bool try_lock_for (const chrono::duration<_Rep, _Period>& __d) {
256+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_for (const chrono::duration<_Rep, _Period>& __d) {
257257 return try_lock_until (chrono::steady_clock::now () + __d);
258258 }
259259
260260 template <class _Clock , class _Duration >
261- _LIBCPP_HIDE_FROM_ABI bool try_lock_until (const chrono::time_point<_Clock, _Duration>& __t ) {
261+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_until (const chrono::time_point<_Clock, _Duration>& __t ) {
262262 using namespace chrono ;
263263 unique_lock<mutex> __lk (__m_);
264264 bool __no_timeout = _Clock::now () < __t ;
@@ -288,14 +288,14 @@ public:
288288 recursive_timed_mutex& operator =(const recursive_timed_mutex&) = delete ;
289289
290290 void lock ();
291- bool try_lock () _NOEXCEPT;
291+ [[__nodiscard__]] bool try_lock () _NOEXCEPT;
292292 template <class _Rep , class _Period >
293- _LIBCPP_HIDE_FROM_ABI bool try_lock_for (const chrono::duration<_Rep, _Period>& __d) {
293+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_for (const chrono::duration<_Rep, _Period>& __d) {
294294 return try_lock_until (chrono::steady_clock::now () + __d);
295295 }
296296
297297 template <class _Clock , class _Duration >
298- _LIBCPP_HIDE_FROM_ABI bool try_lock_until (const chrono::time_point<_Clock, _Duration>& __t ) {
298+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_until (const chrono::time_point<_Clock, _Duration>& __t ) {
299299 using namespace chrono ;
300300 __thread_id __id = this_thread::get_id ();
301301 unique_lock<mutex> __lk (__m_);
@@ -320,7 +320,7 @@ public:
320320};
321321
322322template <class _L0 , class _L1 >
323- _LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI int try_lock (_L0& __l0, _L1& __l1) {
323+ [[__nodiscard__]] _LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI int try_lock (_L0& __l0, _L1& __l1) {
324324 unique_lock<_L0> __u0 (__l0, try_to_lock_t ());
325325 if (__u0.owns_lock ()) {
326326 if (__l1.try_lock ()) {
@@ -335,7 +335,7 @@ _LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0,
335335# ifndef _LIBCPP_CXX03_LANG
336336
337337template <class _L0 , class _L1 , class _L2 , class ... _L3>
338- _LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI int try_lock (_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
338+ [[__nodiscard__]] _LIBCPP_NO_THREAD_SAFETY_ANALYSIS _LIBCPP_HIDE_FROM_ABI int try_lock (_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
339339 int __r = 0 ;
340340 unique_lock<_L0> __u0 (__l0, try_to_lock);
341341 if (__u0.owns_lock ()) {
0 commit comments