Skip to content

Commit

Permalink
Merge pull request #17 from cramertj/futures-cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
cramertj authored Jan 23, 2019
2 parents 05db198 + af3da95 commit eff2eca
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions text/0000-futures.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ and which can be stored by the implementation of those `Futures`s. Whenever a
waker in order to inform the executor that the task which owns the `Future`
should get scheduled and executed again.

The RFC defines a concrete `Waker` types with which implementors of `Futures`
The RFC defines a concrete `Waker` type with which implementors of `Futures`
and asynchronous functions will interact. This type defines a `wake(&self)`
function which is used to schedule the task that is associated to the `Waker`
method which is used to schedule the task that is associated to the `Waker`
to be polled again.

The mechanism through which tasks get scheduled again depends on the executor
Expand All @@ -191,7 +191,7 @@ Possible ways of waking up a an executor include:
- If the executor's thread is parked, the wakeup call needs to unpark it.

To allow executors to implement custom wakeup behavior, the `Waker` type
internally contains a type called `RawWaker`, which consists of a pointer
contains a type called `RawWaker`, which consists of a pointer
to a custom wakeable object and a reference to a virtual function
pointer table (vtable) which provides functions to `clone`, `wake`, and
`drop` the underlying wakeable object.
Expand Down Expand Up @@ -295,10 +295,7 @@ impl Waker {
impl Clone for Waker {
fn clone(&self) -> Self {
Waker {
waker: RawWaker {
data: unsafe { (self.waker.vtable.clone)(self.waker.data) },
vtable: self.waker.vtable,
}
waker: unsafe { (self.waker.vtable.clone)(self.waker.data) },
}
}
}
Expand Down

0 comments on commit eff2eca

Please sign in to comment.