Clean up some stale comments

This commit is contained in:
Peter Ammon 2024-12-22 15:49:14 -08:00
parent f5a02e590d
commit 6dad396498
No known key found for this signature in database
2 changed files with 3 additions and 10 deletions

View File

@ -178,7 +178,7 @@ impl FdEventSignaller {
}
}
/// Each item added to fd_monitor_t is assigned a unique ID, which is not recycled. Items may have
/// Each item added to FdMonitor is assigned a unique ID, which is not recycled. Items may have
/// their callback triggered immediately by passing the ID. Zero is a sentinel.
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct FdMonitorItemId(u64);
@ -481,7 +481,6 @@ impl BackgroundFdMonitor {
// Service all items that are either readable or have timed out, and remove any which
// say to do so.
self.items
.retain_mut(|item| servicer(item) == ItemAction::Retain);
@ -541,9 +540,6 @@ impl BackgroundFdMonitor {
/// fds arounds; this is why it's very hacky!
impl Drop for FdMonitor {
fn drop(&mut self) {
// Safety: this is a port of the C++ code and we are running in the destructor. The C++ code
// had no way to bubble back any errors encountered here, and the pthread mutex the C++ code
// uses does not have a concept of mutex poisoning.
self.data.lock().expect("Mutex poisoned!").terminate = true;
self.change_signaller.post();

View File

@ -23,11 +23,8 @@ pub const FIRST_HIGH_FD: RawFd = 10;
/// A sentinel value indicating no timeout.
pub const NO_TIMEOUT: u64 = u64::MAX;
/// A helper type for managing and automatically closing a file descriptor
///
/// This was implemented in rust as a port of the existing C++ code but it didn't take its place
/// (yet) and there's still the original cpp implementation in `src/fds.h`, so its name is
/// disambiguated because some code uses a mix of both for interop purposes.
/// A helper type for managing and automatically closing a file descriptor.
/// Importantly this supports an invalid state with an fd of -1.
pub struct AutoCloseFd {
fd_: RawFd,
}