Skip to content

Commit

Permalink
Remove unnecessary mutex lock and drop in pipeline serialization (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets authored Jan 29, 2025
1 parent 9ba08eb commit 6f7c089
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions io/zenoh-transport/src/common/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ impl StageIn {
break batch;
}
None => {
drop(c_guard);
// Wait for an available batch until deadline
if !deadline.wait(&self.s_ref)? {
// Still no available batch.
Expand All @@ -288,7 +287,6 @@ impl StageIn {
);
return Ok(false);
}
c_guard = self.mutex.current();
}
},
}
Expand Down Expand Up @@ -441,11 +439,9 @@ impl StageIn {
break batch;
}
None => {
drop(c_guard);
if !self.s_ref.wait() {
return false;
}
c_guard = self.mutex.current();
}
},
}
Expand Down

0 comments on commit 6f7c089

Please sign in to comment.