Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ impl<T: Slot> Turbine<T> {
//let diff = self.current_pos - v.load();
min_cursor = min(min_cursor, v.load());

if self.current_pos - min_cursor >= self.size as u64 {
if self.current_pos.wrapping_sub(min_cursor) >= self.size as u64 {
debug!("Not writeable! {} - {} == {}, which is >= {}", self.current_pos, min_cursor, (self.current_pos - min_cursor), self.size);
return false;
}
Expand Down Expand Up @@ -848,7 +848,7 @@ mod test {
}

debug!("Exit write loop");
if rx.recv().is_err() == true {panic!()}
assert!(!rx.recv().is_err());
debug!("Recv_opt done");
return;
//
Expand Down Expand Up @@ -1144,7 +1144,11 @@ mod test {
counter += 1;
let end = precise_time_ns();
let start = rx_bench.recv().ok().unwrap();
let total = ((end - start) as i64).abs() as u64; // because ticks can go backwards between different cores
let total = if end > start {
end - start
} else {
start - end
}; // because ticks can go backwards between different cores
latencies.push(total);
//error!("{}, {}, {}", start, end, total);
}
Expand Down