mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
Kernel: Use RefPtr instead of LockRefPtr for File and subclasses
This was mostly straightforward, as all the storage locations are guarded by some related mutex. The use of old-school associated mutexes instead of MutexProtected is unfortunate, but the process to modernize such code is ongoing.
This commit is contained in:
parent
61bb9103c2
commit
03cc45e5a2
20 changed files with 63 additions and 63 deletions
|
@ -20,7 +20,7 @@ class OpenFileDescription;
|
|||
|
||||
class Socket : public File {
|
||||
public:
|
||||
static ErrorOr<NonnullLockRefPtr<Socket>> create(int domain, int type, int protocol);
|
||||
static ErrorOr<NonnullRefPtr<Socket>> create(int domain, int type, int protocol);
|
||||
virtual ~Socket() override;
|
||||
|
||||
int domain() const { return m_domain; }
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
void set_connected(bool);
|
||||
|
||||
bool can_accept() const { return !m_pending.is_empty(); }
|
||||
LockRefPtr<Socket> accept();
|
||||
RefPtr<Socket> accept();
|
||||
|
||||
ErrorOr<void> shutdown(int how);
|
||||
|
||||
|
@ -111,7 +111,7 @@ public:
|
|||
protected:
|
||||
Socket(int domain, int type, int protocol);
|
||||
|
||||
ErrorOr<void> queue_connection_from(NonnullLockRefPtr<Socket>);
|
||||
ErrorOr<void> queue_connection_from(NonnullRefPtr<Socket>);
|
||||
|
||||
size_t backlog() const { return m_backlog; }
|
||||
void set_backlog(size_t backlog) { m_backlog = backlog; }
|
||||
|
@ -181,7 +181,7 @@ private:
|
|||
|
||||
Optional<ErrnoCode> m_so_error;
|
||||
|
||||
Vector<NonnullLockRefPtr<Socket>> m_pending;
|
||||
Vector<NonnullRefPtr<Socket>> m_pending;
|
||||
};
|
||||
|
||||
// This is a special variant of TRY() that also updates the socket's SO_ERROR field on error.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue