mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 18:17:23 +00:00
LibIPC: Protect underlying socket of TransportSocket with RWLock
This is necessary to prevent the socket from being closed while it is being used for reading or writing.
This commit is contained in:
parent
14dc7686c3
commit
681333d329
Notes:
github-actions[bot]
2025-04-10 21:41:11 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 681333d329
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4313
Reviewed-by: https://github.com/ADKaster
2 changed files with 11 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <LibIPC/UnprocessedFileDescriptors.h>
|
||||
#include <LibThreading/ConditionVariable.h>
|
||||
#include <LibThreading/MutexProtected.h>
|
||||
#include <LibThreading/RWLock.h>
|
||||
#include <LibThreading/Thread.h>
|
||||
|
||||
namespace IPC {
|
||||
|
@ -104,6 +105,7 @@ private:
|
|||
static ErrorOr<void> send_message(Core::LocalSocket&, ReadonlyBytes& bytes, Vector<int>& unowned_fds);
|
||||
|
||||
NonnullOwnPtr<Core::LocalSocket> m_socket;
|
||||
mutable Threading::RWLock m_socket_rw_lock;
|
||||
ByteBuffer m_unprocessed_bytes;
|
||||
UnprocessedFileDescriptors m_unprocessed_fds;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue