refactor: remove ScopedTask (#2125)

* replace ScopedTask with AbortOnDropHandle
This commit is contained in:
Luna Yao
2026-04-25 15:20:25 +08:00
committed by GitHub
parent 820d9095d3
commit 5a1668c753
32 changed files with 161 additions and 300 deletions
+3 -4
View File
@@ -22,8 +22,7 @@ use smoltcp::{
pub use socket::{TcpListener, TcpStream, UdpSocket};
pub use socket_allocator::BufferSize;
use tokio::sync::Notify;
use crate::common::scoped_task::ScopedTask;
use tokio_util::task::AbortOnDropHandle;
/// The async devices.
pub mod channel_device;
@@ -79,7 +78,7 @@ pub struct Net {
ip_addr: IpCidr,
from_port: AtomicU16,
stopper: Arc<Notify>,
fut: ScopedTask<io::Result<()>>,
fut: AbortOnDropHandle<io::Result<()>>,
}
impl std::fmt::Debug for Net {
@@ -131,7 +130,7 @@ impl Net {
ip_addr: config.ip_addr,
from_port: AtomicU16::new(10001),
stopper,
fut: ScopedTask::from(tokio::spawn(fut)),
fut: AbortOnDropHandle::new(tokio::spawn(fut)),
}
}
pub fn get_address(&self) -> IpAddr {