From daf73d7c630eeacc00635a7ffe2f152159a86916 Mon Sep 17 00:00:00 2001 From: Radiant <69520693+RadiantUwU@users.noreply.github.com> Date: Fri, 24 May 2024 00:08:37 +0300 Subject: [PATCH] Remove the limitation of try_lock being a protected function. --- library/std/src/sync/reentrant_lock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sync/reentrant_lock.rs b/library/std/src/sync/reentrant_lock.rs index 80b9e0cf15214..9c74431144f1e 100644 --- a/library/std/src/sync/reentrant_lock.rs +++ b/library/std/src/sync/reentrant_lock.rs @@ -222,7 +222,7 @@ impl ReentrantLock { /// Otherwise, an RAII guard is returned. /// /// This function does not block. - pub(crate) fn try_lock(&self) -> Option> { + pub fn try_lock(&self) -> Option> { let this_thread = current_thread_unique_ptr(); // Safety: We only touch lock_count when we own the lock. unsafe {