From 5257f3f01ac953c48fce0c35766782497e11c044 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Fri, 24 May 2024 16:17:19 -0700 Subject: [PATCH] Add manual Sync impl for ReentrantLockGuard Fixes: #125526 --- std/src/sync/reentrant_lock.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/std/src/sync/reentrant_lock.rs b/std/src/sync/reentrant_lock.rs index 80b9e0cf15214..f7fe8eb1c7fd5 100644 --- a/std/src/sync/reentrant_lock.rs +++ b/std/src/sync/reentrant_lock.rs @@ -116,6 +116,9 @@ pub struct ReentrantLockGuard<'a, T: ?Sized + 'a> { #[unstable(feature = "reentrant_lock", issue = "121440")] impl !Send for ReentrantLockGuard<'_, T> {} +#[unstable(feature = "reentrant_lock", issue = "121440")] +unsafe impl Sync for ReentrantLockGuard<'_, T> {} + #[unstable(feature = "reentrant_lock", issue = "121440")] impl ReentrantLock { /// Creates a new re-entrant lock in an unlocked state ready for use.