summaryrefslogtreecommitdiffstats
path: root/third_party/rust/interrupt-support/src/shutdown.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/rust/interrupt-support/src/shutdown.rs
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/interrupt-support/src/shutdown.rs')
-rw-r--r--third_party/rust/interrupt-support/src/shutdown.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/rust/interrupt-support/src/shutdown.rs b/third_party/rust/interrupt-support/src/shutdown.rs
index 9c64df27e8..88a56029b8 100644
--- a/third_party/rust/interrupt-support/src/shutdown.rs
+++ b/third_party/rust/interrupt-support/src/shutdown.rs
@@ -12,13 +12,14 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
///
/// Here's how add shutdown support to a component:
///
-/// - Use `SqlInterruptScope::new_with_shutdown_check()` to create a new
-/// `SqlInterruptScope`
/// - Database connections need to be wrapped in a type that:
/// - Implements `AsRef<SqlInterruptHandle>`.
/// - Gets wrapped in an `Arc<>`. This is needed so the shutdown code can get a weak reference to
/// the instance.
/// - Calls `register_interrupt()` on creation
+/// - Use `SqlInterruptScope::begin_interrupt_scope()` before each operation.
+/// This will return an error if shutdown mode is in effect.
+/// The interrupt scope should be periodically checked to handle the operation being interrupted/shutdown after it started.
///
/// See `PlacesDb::begin_interrupt_scope()` and `PlacesApi::new_connection()` for an example of
/// how this works.