diff --git a/Cargo.lock b/Cargo.lock index c3d4b9d..e9f40c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,20 +85,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" -[[package]] -name = "curio" -version = "0.1.0" -dependencies = [ - "env_logger", - "io-uring", - "libc", - "log", - "send_wrapper", - "slab", - "slotmap", - "unchecked-refcell", -] - [[package]] name = "defmt" version = "1.1.1" @@ -388,6 +374,20 @@ version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" +[[package]] +name = "uring_async" +version = "0.1.0" +dependencies = [ + "env_logger", + "io-uring", + "libc", + "log", + "send_wrapper", + "slab", + "slotmap", + "unchecked-refcell", +] + [[package]] name = "utf8parse" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index 6b4208e..817216f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "curio" +name = "uring_async" version = "0.1.0" edition = "2024" diff --git a/src/lib.rs b/src/lib.rs index 045fce5..314dc66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,8 @@ impl Runtime { .setup_no_sqarray() .build(128) .expect("failed to create ring"); + assert!(ring.params().is_feature_nodrop(), "missing IORING_FEAT_NODROP (kernel 5.19)"); + assert!(ring.params().is_feature_ext_arg(), "missing IORING_FEAT_EXT_ARG (kernel 5.11)"); let submitter = ring.submitter(); submitter .register_restrictions(&mut [Restriction::sqe_op(Nop::CODE)]) @@ -95,7 +97,7 @@ impl Runtime { if lock.is_some() { panic!("runtime already initialized on this thread"); } - *lock = Some(Runtime(Rc::clone(&self.0))) + *lock = Some(Runtime(Rc::clone(&self.0))); }); let mut lock = self.0.borrow_mut(); @@ -211,6 +213,10 @@ impl Runtime { lock = self.0.borrow_mut(); } } + RT.with(|cell| { + let mut lock = cell.borrow_mut(); + *lock = None; + }); trace!("Exiting"); } }