Skip to content

Commit

Permalink
Merge #47
Browse files Browse the repository at this point in the history
47: Allow to check if systems are running, without waiting for them. r=torkleyy a=Binero

Useful for when you want to use the available time on the main thread.
  • Loading branch information
bors[bot] committed Sep 2, 2017
2 parents a2c3949 + d40b804 commit db43c75
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dispatch/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ impl<'a> AsyncDispatcher<'a> {
.expect("The worker thread may have panicked");
}


/// Checks if any of the asynchronously dispatched systems are running.
pub fn is_running(&self) -> bool {
if let Some(ref signal) = self.signal {
signal.is_pending()
} else {
false
}
}

/// Dispatch only thread local systems sequentially.
///
/// If `wait_without_tl()` or `wait()` wasn't called before,
Expand Down

0 comments on commit db43c75

Please sign in to comment.