diff options
author | Chih-hung Hsieh <chh@google.com> | 2020-11-05 23:03:37 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-11-05 23:03:37 +0000 |
commit | 8414138e74aa469015108049230e70b0a325c6e9 (patch) | |
tree | deaa1e4c18a6a0624b02ead4f7fdd5bf985235d1 /src/poll.rs | |
parent | 3c582418efff72b2eb8934627f9ee0281ed79163 (diff) | |
parent | 3a1a50620397b347db105e65b3cab650c2c7bb72 (diff) | |
download | mio-8414138e74aa469015108049230e70b0a325c6e9.tar.gz |
Merge "Upgrade rust/crates/mio to 0.7.5"
Diffstat (limited to 'src/poll.rs')
-rw-r--r-- | src/poll.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/poll.rs b/src/poll.rs index 6446281..7ff2038 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -613,6 +613,15 @@ impl Registry { .try_clone() .map(|selector| Registry { selector }) } + + /// Internal check to ensure only a single `Waker` is active per [`Poll`] + /// instance. + #[cfg(debug_assertions)] + pub(crate) fn register_waker(&self) { + if self.selector.register_waker() { + panic!("Only a single `Waker` can be active per `Poll` instance"); + } + } } impl fmt::Debug for Registry { |