kernel/locks: De-duplicate two inlined methods.

The functions declared in locks.h were and are exactly identical
to these inline blocks of code. So, rather than duplicate them,
just invoke them directly. The compiler will probably inline them
anyway.
This commit is contained in:
Augustin Cavalier
2023-06-19 13:23:22 -04:00
parent 79572316c4
commit 5e8058566c
+2 -14
View File
@@ -240,13 +240,7 @@ recursive_lock_switch_from_read_lock(rw_lock* from, recursive_lock* to)
to->holder = thread; to->holder = thread;
#endif #endif
} else { } else {
#if KDEBUG_RW_LOCK_DEBUG rw_lock_read_unlock(from);
_rw_lock_write_unlock(from);
#else
int32 oldCount = atomic_add(&from->count, -1);
if (oldCount >= RW_LOCK_WRITER_COUNT_BASE)
_rw_lock_read_unlock(from);
#endif
} }
to->recursion++; to->recursion++;
@@ -859,13 +853,7 @@ mutex_switch_from_read_lock(rw_lock* from, mutex* to)
InterruptsSpinLocker locker(to->lock); InterruptsSpinLocker locker(to->lock);
#if KDEBUG_RW_LOCK_DEBUG rw_lock_read_unlock(from);
_rw_lock_write_unlock(from);
#else
int32 oldCount = atomic_add(&from->count, -1);
if (oldCount >= RW_LOCK_WRITER_COUNT_BASE)
_rw_lock_read_unlock(from);
#endif
return mutex_lock_threads_locked(to, &locker); return mutex_lock_threads_locked(to, &locker);
} }