epoll: remove extraneous clone of ready_list
A simplification that doesn't impact the epoll implementation's logic. It is not necessary to clone the ready_list before reading its `is_empty` state. This avoids the clone step but more importantly avoids the invisible drop step of the clone.
This commit is contained in:
parent
86bb1373aa
commit
81202c8b13
@ -475,8 +475,7 @@ fn epoll_wait(
|
|||||||
let epoll_file_description = epfd
|
let epoll_file_description = epfd
|
||||||
.downcast::<Epoll>()
|
.downcast::<Epoll>()
|
||||||
.ok_or_else(|| err_unsup_format!("non-epoll FD passed to `epoll_wait`"))?;
|
.ok_or_else(|| err_unsup_format!("non-epoll FD passed to `epoll_wait`"))?;
|
||||||
let binding = epoll_file_description.get_ready_list();
|
ready_list_empty = epoll_file_description.ready_list.mapping.borrow().is_empty();
|
||||||
ready_list_empty = binding.mapping.borrow_mut().is_empty();
|
|
||||||
thread_ids = epoll_file_description.thread_id.borrow_mut();
|
thread_ids = epoll_file_description.thread_id.borrow_mut();
|
||||||
}
|
}
|
||||||
if timeout == 0 || !ready_list_empty {
|
if timeout == 0 || !ready_list_empty {
|
||||||
|
Loading…
Reference in New Issue
Block a user