Skip to content

Commit 8407505

Browse files
committed
Added docs for suspending.
1 parent 9f7499b commit 8407505

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ impl Queue {
304304
}
305305
}
306306

307+
/// Suspends the invocation of blocks on self and returns a `SuspendGuard`
308+
/// that can be dropped to resume.
309+
///
310+
/// The suspension occurs after completion of any blocks running at the
311+
/// time of the call.
312+
/// Invocation does not resume until all `SuspendGuard`s have been dropped.
307313
pub fn suspend(&self) -> SuspendGuard {
308314
SuspendGuard::new(self)
309315
}
@@ -329,6 +335,7 @@ impl Drop for Queue {
329335
}
330336
}
331337

338+
/// An RAII guard which will resume a suspended `Queue` when dropped.
332339
pub struct SuspendGuard {
333340
queue: Queue,
334341
}
@@ -341,6 +348,7 @@ impl SuspendGuard {
341348
SuspendGuard { queue: queue.clone() }
342349
}
343350

351+
/// Drops self, allowing the suspended `Queue` to resume.
344352
pub fn resume(self) { }
345353
}
346354

0 commit comments

Comments
 (0)