mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
Kernel: Some small refinements to the thread blockers.
Committing some things my hands did while browsing through this code. - Mark all leaf classes "final". - FileDescriptionBlocker now stores a NonnullRefPtr<FileDescription>. - FileDescriptionBlocker::blocked_description() now returns a reference. - ConditionBlocker takes a Function&&.
This commit is contained in:
parent
80a6df9022
commit
705cd2491c
5 changed files with 49 additions and 54 deletions
|
@ -143,14 +143,16 @@ ssize_t FileDescription::write(const u8* data, ssize_t size)
|
|||
return nwritten;
|
||||
}
|
||||
|
||||
bool FileDescription::can_write()
|
||||
bool FileDescription::can_write() const
|
||||
{
|
||||
return m_file->can_write(*this);
|
||||
// FIXME: Remove this const_cast.
|
||||
return m_file->can_write(const_cast<FileDescription&>(*this));
|
||||
}
|
||||
|
||||
bool FileDescription::can_read()
|
||||
bool FileDescription::can_read() const
|
||||
{
|
||||
return m_file->can_read(*this);
|
||||
// FIXME: Remove this const_cast.
|
||||
return m_file->can_read(const_cast<FileDescription&>(*this));
|
||||
}
|
||||
|
||||
ByteBuffer FileDescription::read_entire_file()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue