Skip to content

Commit

Permalink
stylistic stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
problame committed Oct 17, 2023
1 parent c68452b commit df48340
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
resolver = "2"

members = [
"tokio-epoll-uring",
"benchmark",
Expand Down
1 change: 0 additions & 1 deletion tokio-epoll-uring/src/system/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ async fn poller_impl(
// From here on, we cannot let ourselves be cancelled at an `.await` anymore.
// (See comment on `yield_now().await` above why cancellation is safe earlier.)
// Use a closure to enforce it.

#[allow(clippy::redundant_closure_call)]
(move || {
let mut poller_guard = poller.lock().unwrap();
Expand Down
3 changes: 1 addition & 2 deletions tokio-epoll-uring/src/system/lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ impl System {
}
}

type ShutdownDoneTx = tokio::sync::oneshot::Sender<()>;
pub(crate) struct ShutdownRequest {
pub done_tx: Option<ShutdownDoneTx>,
pub done_tx: Option<tokio::sync::oneshot::Sender<()>>,
pub submit_side_inner: Arc<tokio::sync::Mutex<SubmitSideInner>>,
}

Expand Down
4 changes: 2 additions & 2 deletions tokio-epoll-uring/src/system/submission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ impl SubmitSideOpen {
pub struct SubmitSideWeak(Weak<tokio::sync::Mutex<SubmitSideInner>>);

impl SubmitSideWeak {
pub(crate) async fn with_submit_side_open(&self) -> Option<SubmitSideOpenGuard> {
let inner = match self.0.upgrade() {
pub(crate) async fn upgrade_to_open(&self) -> Option<SubmitSideOpenGuard> {
let inner: Arc<tokio::sync::Mutex<SubmitSideInner>> = match self.0.upgrade() {
Some(inner) => inner,
None => return None,
};
Expand Down
4 changes: 2 additions & 2 deletions tokio-epoll-uring/src/system/submission/op_fut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where
// FIXME: probably dont need the unpin
O: Op + Send + 'static + Unpin,
{
let open_guard = match submit_side.with_submit_side_open().await {
let open_guard = match submit_side.upgrade_to_open().await {
Some(open) => open,
None => {
return (
Expand Down Expand Up @@ -89,7 +89,7 @@ where
} else {
None
};
drop(open_guard); // drop it asap
drop(open_guard); // drop it asap to enable timely shutdown

if let Some(mut cq) = cq_guard {
// opportunistically process completion immediately
Expand Down

0 comments on commit df48340

Please sign in to comment.