mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-30 11:13:55 +00:00
Support T:?Sized as type parameter for Mutex, SpinLock, RwLock, and RwMutex
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
92a9f5616e
commit
dac41e9a2f
@ -12,7 +12,7 @@ use super::{common::IfaceCommon, internal::IfaceInternal, Iface};
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct IfaceVirtio {
|
||||
driver: Arc<SpinLock<Box<dyn AnyNetworkDevice>>>,
|
||||
driver: Arc<SpinLock<dyn AnyNetworkDevice>>,
|
||||
common: IfaceCommon,
|
||||
dhcp_handle: SocketHandle,
|
||||
weak_self: Weak<Self>,
|
||||
@ -32,7 +32,7 @@ impl IfaceVirtio {
|
||||
));
|
||||
config
|
||||
};
|
||||
let mut interface = smoltcp::iface::Interface::new(config, &mut **virtio_net.lock());
|
||||
let mut interface = smoltcp::iface::Interface::new(config, &mut *virtio_net.lock());
|
||||
interface.update_ip_addrs(|ip_addrs| {
|
||||
debug_assert!(ip_addrs.is_empty());
|
||||
ip_addrs.push(ip_addr).unwrap();
|
||||
@ -115,7 +115,7 @@ impl Iface for IfaceVirtio {
|
||||
|
||||
fn poll(&self) {
|
||||
let mut driver = self.driver.lock_irq_disabled();
|
||||
self.common.poll(&mut **driver);
|
||||
self.common.poll(&mut *driver);
|
||||
self.process_dhcp();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user