Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
davibe committed Oct 2, 2023
1 parent 7a23e16 commit 990870f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ impl ReactorLock<'_> {
// Collect wakers if a writability event was emitted.
for &(dir, emitted) in &[(WRITE, ev.writable), (READ, ev.readable)] {
if emitted {
println!("delivering event dir: {}, tick: {}", dir, tick);
state[dir].tick = tick;
state[dir].drain_into(&mut wakers);
}
Expand Down Expand Up @@ -443,6 +444,10 @@ impl Source {
if let Some((a, b)) = state[dir].ticks {
// If `state[dir].tick` has changed to a value other than the old reactor tick,
// that means a newer reactor tick has delivered an event.
println!(
"checking ticks dir: {}, cur: {}, saved: {}, {}",
dir, state[dir].tick, a, b
);
if state[dir].tick != a && state[dir].tick != b {
state[dir].ticks = None;
return Poll::Ready(Ok(()));
Expand All @@ -465,6 +470,8 @@ impl Source {
state[dir].ticks = Some((Reactor::get().ticker(), state[dir].tick));
}

println!("saving ticks dir: {}, ticks: {:?}", dir, state[dir].ticks);

// Update interest in this I/O handle.
if was_empty {
// Create the event that we are interested in.
Expand Down

0 comments on commit 990870f

Please sign in to comment.