diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-07 15:42:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-07 18:49:27 +0200 |
commit | 0cb6c3c8319711eb25518ee9bc2d62f4a1805027 (patch) | |
tree | 771719ee4f83f2fdcbf428b6aa18dd18f18ef0d6 /Kernel/Net/TCPSocket.h | |
parent | 4c582b57e9522bcca0bc2277cdb44b6085b17676 (diff) | |
download | serenity-0cb6c3c8319711eb25518ee9bc2d62f4a1805027.zip |
Kernel/TCP: Port TCP retransmit queue to ProtectedValue
I had to switch to exclusive locking since ProtectedValue rightly
doesn't allow you to mutate protected data with only a shared lock.
Diffstat (limited to 'Kernel/Net/TCPSocket.h')
-rw-r--r-- | Kernel/Net/TCPSocket.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Kernel/Net/TCPSocket.h b/Kernel/Net/TCPSocket.h index 9422f78598..a85145db4b 100644 --- a/Kernel/Net/TCPSocket.h +++ b/Kernel/Net/TCPSocket.h @@ -203,9 +203,12 @@ private: int tx_counter { 0 }; }; - mutable Mutex m_not_acked_lock { "TCPSocket unacked packets" }; - SinglyLinkedList<OutgoingPacket> m_not_acked; - size_t m_not_acked_size { 0 }; + struct UnackedPackets { + SinglyLinkedList<OutgoingPacket> packets; + size_t size { 0 }; + }; + + ProtectedValue<UnackedPackets> m_unacked_packets; u32 m_duplicate_acks { 0 }; |