mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Remove the nonsense mutex in Poller
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
94eba6d85e
commit
9f125cd671
@ -126,7 +126,7 @@ impl Connected {
|
||||
.set_peer_requested_shutdown()
|
||||
}
|
||||
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&mut Poller>) -> IoEvents {
|
||||
self.pollee.poll(mask, poller)
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ impl Connecting {
|
||||
self.info.lock_irq_disabled().update_for_event(event)
|
||||
}
|
||||
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&mut Poller>) -> IoEvents {
|
||||
self.pollee.poll(mask, poller)
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ impl Init {
|
||||
*self.bound_addr.lock()
|
||||
}
|
||||
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&mut Poller>) -> IoEvents {
|
||||
self.pollee.poll(mask, poller)
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ impl Listen {
|
||||
Ok(connection)
|
||||
}
|
||||
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
pub fn poll(&self, mask: IoEvents, poller: Option<&mut Poller>) -> IoEvents {
|
||||
self.pollee.poll(mask, poller)
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ impl VsockStreamSocket {
|
||||
}
|
||||
|
||||
impl Pollable for VsockStreamSocket {
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&mut Poller>) -> IoEvents {
|
||||
match &*self.status.read() {
|
||||
Status::Init(init) => init.poll(mask, poller),
|
||||
Status::Listen(listen) => listen.poll(mask, poller),
|
||||
@ -210,9 +210,9 @@ impl Socket for VsockStreamSocket {
|
||||
vsockspace.request(&connecting.info()).unwrap();
|
||||
// wait for response from driver
|
||||
// TODO: Add timeout
|
||||
let poller = Poller::new();
|
||||
let mut poller = Poller::new();
|
||||
if !connecting
|
||||
.poll(IoEvents::IN, Some(&poller))
|
||||
.poll(IoEvents::IN, Some(&mut poller))
|
||||
.contains(IoEvents::IN)
|
||||
{
|
||||
if let Err(e) = poller.wait() {
|
||||
|
Reference in New Issue
Block a user