summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-29 01:47:18 +0200
committerAndreas Kling <kling@serenityos.org>2022-01-29 16:45:39 +0100
commite28af4a2fc2596502ab7d31bdd6d64a50abe6c5d (patch)
treeca2b39a7d76ba32fc844534acd51939be663855b /Kernel/Net
parent60aa4152e946437eae0d44749558e6b2b848246c (diff)
downloadserenity-e28af4a2fc2596502ab7d31bdd6d64a50abe6c5d.zip
Kernel: Stop using HashMap in Mutex
This commit removes the usage of HashMap in Mutex, thereby making Mutex be allocation-free. In order to achieve this several simplifications were made to Mutex, removing unused code-paths and extra VERIFYs: * We no longer support 'upgrading' a shared lock holder to an exclusive holder when it is the only shared holder and it did not unlock the lock before relocking it as exclusive. NOTE: Unlike the rest of these changes, this scenario is not VERIFY-able in an allocation-free way, as a result the new LOCK_SHARED_UPGRADE_DEBUG debug flag was added, this flag lets Mutex allocate in order to detect such cases when debugging a deadlock. * We no longer support checking if a Mutex is locked by the current thread when the Mutex was not locked exclusively, the shared version of this check was not used anywhere. * We no longer support force unlocking/relocking a Mutex if the Mutex was not locked exclusively, the shared version of these functions was not used anywhere.
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/Socket.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h
index 013172c11c..979df8b27c 100644
--- a/Kernel/Net/Socket.h
+++ b/Kernel/Net/Socket.h
@@ -132,7 +132,7 @@ protected:
ErrorOr<void> so_error() const
{
- VERIFY(m_mutex.is_locked_by_current_thread());
+ VERIFY(m_mutex.is_exclusively_locked_by_current_thread());
return m_so_error;
}