mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-16 17:46:48 +00:00
Don't hold any locks while waiting in EpollFile
This commit is contained in:
parent
64e43d34aa
commit
c68302f700
@ -106,9 +106,11 @@ fn do_epoll_wait(
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let epoll_file_arc = {
|
||||||
let file_table = ctx.process.file_table().lock();
|
let file_table = ctx.process.file_table().lock();
|
||||||
let epoll_file = file_table
|
file_table.get_file(epfd)?.clone()
|
||||||
.get_file(epfd)?
|
};
|
||||||
|
let epoll_file = epoll_file_arc
|
||||||
.downcast_ref::<EpollFile>()
|
.downcast_ref::<EpollFile>()
|
||||||
.ok_or(Error::with_message(Errno::EINVAL, "not epoll file"))?;
|
.ok_or(Error::with_message(Errno::EINVAL, "not epoll file"))?;
|
||||||
let result = epoll_file.wait(max_events, timeout.as_ref());
|
let result = epoll_file.wait(max_events, timeout.as_ref());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user