mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
threadpool: rename inner to something more descriptive (#768)
`inner` is a fitting name for variables of type named `Inner`, but in other cases I find them confusing - sometimes `inner` refers to a `Pool`, sometimes to a `Sender`. I renamed a bunch of variables named `inner` to be more descriptive. This PR is the first step in an effort of splitting https://github.com/tokio-rs/tokio/pull/722#issuecomment-439552671 into multiple PRs.
This commit is contained in:
@@ -16,12 +16,12 @@ use futures::{Future, Poll, Async};
|
||||
/// [`shutdown_now`]: struct.ThreadPool.html#method.shutdown_now
|
||||
#[derive(Debug)]
|
||||
pub struct Shutdown {
|
||||
pub(crate) inner: Sender,
|
||||
pub(crate) sender: Sender,
|
||||
}
|
||||
|
||||
impl Shutdown {
|
||||
fn inner(&self) -> &Pool {
|
||||
&*self.inner.inner
|
||||
fn pool(&self) -> &Pool {
|
||||
&*self.sender.pool
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ impl Future for Shutdown {
|
||||
fn poll(&mut self) -> Poll<(), ()> {
|
||||
use futures::task;
|
||||
|
||||
self.inner().shutdown_task.task.register_task(task::current());
|
||||
self.pool().shutdown_task.task.register_task(task::current());
|
||||
|
||||
if !self.inner().is_shutdown() {
|
||||
if !self.pool().is_shutdown() {
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user