mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Kernel: Convert TCP retransmit queue from HashTable to IntrusiveList
This commit is contained in:
parent
7063303022
commit
6a20733fcd
3 changed files with 13 additions and 8 deletions
|
@ -512,24 +512,24 @@ KResult TCPSocket::close()
|
|||
return result;
|
||||
}
|
||||
|
||||
static Singleton<ProtectedValue<HashTable<TCPSocket*>>> s_sockets_for_retransmit;
|
||||
static Singleton<ProtectedValue<TCPSocket::RetransmitList>> s_sockets_for_retransmit;
|
||||
|
||||
ProtectedValue<HashTable<TCPSocket*>>& TCPSocket::sockets_for_retransmit()
|
||||
ProtectedValue<TCPSocket::RetransmitList>& TCPSocket::sockets_for_retransmit()
|
||||
{
|
||||
return *s_sockets_for_retransmit;
|
||||
}
|
||||
|
||||
void TCPSocket::enqueue_for_retransmit()
|
||||
{
|
||||
sockets_for_retransmit().with_exclusive([&](auto& table) {
|
||||
table.set(this);
|
||||
sockets_for_retransmit().with_exclusive([&](auto& list) {
|
||||
list.append(*this);
|
||||
});
|
||||
}
|
||||
|
||||
void TCPSocket::dequeue_for_retransmit()
|
||||
{
|
||||
sockets_for_retransmit().with_exclusive([&](auto& table) {
|
||||
table.remove(this);
|
||||
sockets_for_retransmit().with_exclusive([&](auto& list) {
|
||||
list.remove(*this);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue