diff options
Diffstat (limited to 'Kernel/Locking/LockRank.cpp')
-rw-r--r-- | Kernel/Locking/LockRank.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Kernel/Locking/LockRank.cpp b/Kernel/Locking/LockRank.cpp new file mode 100644 index 0000000000..62efe7400d --- /dev/null +++ b/Kernel/Locking/LockRank.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021, Brian Gianforcaro <bgianf@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include <Kernel/Locking/LockRank.h> +#include <Kernel/Thread.h> + +// Note: These stubs can't be in LockRank.h as that would create +// a cyclic dependency in the header include graph of the Kernel. + +namespace Kernel { + +void track_lock_acquire(LockRank rank) +{ + auto thread = Thread::current(); + if (thread && !thread->is_crashing()) + thread->track_lock_acquire(rank); +} + +void track_lock_release(LockRank rank) +{ + auto thread = Thread::current(); + if (thread && !thread->is_crashing()) + thread->track_lock_release(rank); +} + +} |