diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-05-13 02:50:01 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-14 11:32:50 +0200 |
commit | 4728f2af8064e76f499d2ae5a957afff6330eb30 (patch) | |
tree | 88c7f4bc07221031fdefb0657028960937b1963a /AK | |
parent | 879eec6aa8e5abed7bddcf293ff9e584f8ae2c86 (diff) | |
download | serenity-4728f2af8064e76f499d2ae5a957afff6330eb30.zip |
Kernel: Avoid unnecessary time under lock in TCPSocket::create
Avoid holding the sockets_by_tuple lock while allocating the TCPSocket.
While checking if the list contains the item we can also hold the lock
in shared mode, as we are only reading the hash table.
In addition the call to from_tuple appears to be superfluous, as we
created the socket, so we should be able to just return it directly.
This avoids the recursive lock acquisition, as well as the unnecessary
hash table lookups.
Diffstat (limited to 'AK')
0 files changed, 0 insertions, 0 deletions