summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
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/Process.cpp
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/Process.cpp')
-rw-r--r--Kernel/Process.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index ccebd03bf9..7888644471 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -105,7 +105,7 @@ void Process::kill_threads_except_self()
});
u32 dropped_lock_count = 0;
- if (big_lock().force_unlock_if_locked(dropped_lock_count) != LockMode::Unlocked)
+ if (big_lock().force_unlock_exclusive_if_locked(dropped_lock_count) != LockMode::Unlocked)
dbgln("Process {} big lock had {} locks", *this, dropped_lock_count);
}