Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a clause to Notify::notify about panics #561

Merged
merged 1 commit into from
Aug 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/task_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,14 @@ pub trait Notify: Send + Sync {
/// This method takes an `id` as an argument which was transitively passed
/// in from the original call to `Spawn::*_notify`. This id can be used to
/// disambiguate which precise future became ready for polling.
///
/// # Panics
///
/// Since `unpark` may be invoked from arbitrary contexts, it should
/// endeavor not to panic and to do as little work as possible. However, it
/// is not guaranteed not to panic, and callers should be wary. If a panic
/// occurs, that panic may or may not be propagated to the end-user of the
/// future that you'd otherwise wake up.
fn notify(&self, id: usize);

/// This function is called whenever a new copy of `id` is needed.
Expand Down