mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:37:43 +00:00
Kernel: Disable lock rank enforcement by default for now
There are a few violations with signal handling that I won't be able to fix it until later this week. So lets put lock rank enforcement under a debug option for now so other folks don't hit these crashes until rank enforcement is more fleshed out.
This commit is contained in:
parent
44cc6e1662
commit
fbb31b4519
3 changed files with 15 additions and 6 deletions
|
@ -170,6 +170,10 @@
|
||||||
#cmakedefine01 LOCK_IN_CRITICAL_DEBUG
|
#cmakedefine01 LOCK_IN_CRITICAL_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LOCK_RANK_ENFORCEMENT
|
||||||
|
#cmakedefine01 LOCK_RANK_ENFORCEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef LOCK_RESTORE_DEBUG
|
#ifndef LOCK_RESTORE_DEBUG
|
||||||
#cmakedefine01 LOCK_RESTORE_DEBUG
|
#cmakedefine01 LOCK_RESTORE_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,16 +14,20 @@ namespace Kernel {
|
||||||
|
|
||||||
void track_lock_acquire(LockRank rank)
|
void track_lock_acquire(LockRank rank)
|
||||||
{
|
{
|
||||||
auto thread = Thread::current();
|
if constexpr (LOCK_RANK_ENFORCEMENT) {
|
||||||
if (thread && !thread->is_crashing())
|
auto thread = Thread::current();
|
||||||
thread->track_lock_acquire(rank);
|
if (thread && !thread->is_crashing())
|
||||||
|
thread->track_lock_acquire(rank);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void track_lock_release(LockRank rank)
|
void track_lock_release(LockRank rank)
|
||||||
{
|
{
|
||||||
auto thread = Thread::current();
|
if constexpr (LOCK_RANK_ENFORCEMENT) {
|
||||||
if (thread && !thread->is_crashing())
|
auto thread = Thread::current();
|
||||||
thread->track_lock_release(rank);
|
if (thread && !thread->is_crashing())
|
||||||
|
thread->track_lock_release(rank);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,7 @@ set(LINE_EDITOR_DEBUG ON)
|
||||||
set(LOCAL_SOCKET_DEBUG ON)
|
set(LOCAL_SOCKET_DEBUG ON)
|
||||||
set(LOCK_DEBUG ON)
|
set(LOCK_DEBUG ON)
|
||||||
set(LOCK_IN_CRITICAL_DEBUG ON)
|
set(LOCK_IN_CRITICAL_DEBUG ON)
|
||||||
|
set(LOCK_RANK_ENFORCEMENT ON)
|
||||||
set(LOCK_RESTORE_DEBUG ON)
|
set(LOCK_RESTORE_DEBUG ON)
|
||||||
set(LOCK_TRACE_DEBUG ON)
|
set(LOCK_TRACE_DEBUG ON)
|
||||||
set(LOOKUPSERVER_DEBUG ON)
|
set(LOOKUPSERVER_DEBUG ON)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue