From 3d03a3d716ca3b680bee67ba7bce045947a695ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sarek=20H=C3=B8verstad=20Skot=C3=A5m?= Date: Mon, 3 Nov 2025 19:51:15 -0800 Subject: [PATCH] Add BatchSemaphore::close_no_scheduling_point --- shuttle/src/future/batch_semaphore.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shuttle/src/future/batch_semaphore.rs b/shuttle/src/future/batch_semaphore.rs index e437d0f7..5be975e2 100644 --- a/shuttle/src/future/batch_semaphore.rs +++ b/shuttle/src/future/batch_semaphore.rs @@ -394,7 +394,11 @@ impl BatchSemaphore { /// permits and notifies all pending waiters. pub fn close(&self) { thread::switch(); + self.close_no_scheduling_point(); + } + /// Closes the semaphore without invoking `thread::switch` + pub fn close_no_scheduling_point(&self) { self.init_object_id(); let mut state = self.state.borrow_mut(); if state.closed {