mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user