From 664681344afb67d09c083db37968cea5d828d29a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 27 Mar 2021 11:40:46 +0000 Subject: [PATCH] global: Unauthorised: Provide lock_even_poisoned We're going to want this for list-games Signed-off-by: Ian Jackson --- src/global.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/global.rs b/src/global.rs index d24bf579..488ca336 100644 --- a/src/global.rs +++ b/src/global.rs @@ -313,6 +313,14 @@ impl Unauthorised { let must_not_escape = self.by_ref(Authorisation::authorise_any()); Unauthorised::of(must_not_escape.lock()?) } + + pub fn lock_even_poisoned<'r>(&'r self) -> Unauthorised, A> { + let must_not_escape = self.by_ref(Authorisation::authorise_any()); + Unauthorised::of(InstanceGuard { + c: must_not_escape.lock_even_poisoned(), + gref: must_not_escape.clone(), + }) + } } impl Instance { -- 2.30.2