Skip to content

Commit

Permalink
Merge pull request #6 from dragostis/spelling
Browse files Browse the repository at this point in the history
Fixed spelling & some minor inaccuracies.
  • Loading branch information
dragostis committed Sep 18, 2024
2 parents 1a4647c + 179fb82 commit 2e84691
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ impl<T> Future<T> {

thread::park();

// Skip spininning after being woken up.
// Skip yielding after being woken up.
continue;
}
Err(state) if state == Poll::Ready as u8 => {
// `state` is `Poll::Ready` only after after
// `Self::complete` releases the lock.
// `state` is `Poll::Ready` only after `Self::complete`
// releases the lock.
//
// Calling `Self::complete` when `state` is `Poll::Ready`
// cannot mutate `self.val`.
Expand Down Expand Up @@ -147,10 +147,11 @@ impl<T> Job<T> {
{
// The `stack` is still alive.
let stack: &JobStack<F> = unsafe { stack.cast().as_ref() };
// This is the first call to `take_once` the closure since
// `Job::execute` is called only after the job has been popped.
// This is the first call to `take_once` since `Job::execute`
// (the only place where this harness is called) is called only
// after the job has been popped.
let f = unsafe { stack.take_once() };
// Before being popped, the `JobQueue` allocates and store a
// Before being popped, the `JobQueue` allocates and stores a
// `Future` in `self.fur_or_next` that should get passed here.
let fut: &Future<T> = unsafe { fut.cast().as_ref() };

Expand Down Expand Up @@ -178,7 +179,7 @@ impl<T> Job<T> {
self.fut_or_next
.get()
.map(|fut| {
// Before being popped, the `JobQueue` allocates and store a
// Before being popped, the `JobQueue` allocates and stores a
// `Future` in `self.fur_or_next` that should get passed here.
let fut = unsafe { fut.as_ref() };
fut.poll()
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ pub struct Config {
/// The number of threads or `None` to use
/// `std::thread::available_parallelism`.
pub thread_count: Option<usize>,
/// The interaval between heartbeats on any particular thread.
/// The interval between heartbeats on any particular thread.
pub heartbeat_interval: Duration,
}

Expand Down Expand Up @@ -696,7 +696,7 @@ mod tests {
// Since there was no panic up to this point, this means that the
// thread boundary has not been crossed.
//
// Check that the work was done and pass the testt artificially.
// Check that the work was done and pass the test artificially.
if !threads_crossed {
assert_eq!(vals, [1; 10]);
panic!("panicked across threads");
Expand Down

0 comments on commit 2e84691

Please sign in to comment.