mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 08:50:57 +01:00
hle: kernel: k_scheduler_lock: Cleanup.
This commit is contained in:
parent
055194d2ab
commit
6ee8340a6b
1 changed files with 3 additions and 3 deletions
|
@ -23,11 +23,11 @@ public:
|
||||||
explicit KAbstractSchedulerLock(KernelCore& kernel_) : kernel{kernel_} {}
|
explicit KAbstractSchedulerLock(KernelCore& kernel_) : kernel{kernel_} {}
|
||||||
|
|
||||||
bool IsLockedByCurrentThread() const {
|
bool IsLockedByCurrentThread() const {
|
||||||
return this->owner_thread == GetCurrentThreadPointer(kernel);
|
return owner_thread == GetCurrentThreadPointer(kernel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lock() {
|
void Lock() {
|
||||||
if (this->IsLockedByCurrentThread()) {
|
if (IsLockedByCurrentThread()) {
|
||||||
// If we already own the lock, we can just increment the count.
|
// If we already own the lock, we can just increment the count.
|
||||||
ASSERT(lock_count > 0);
|
ASSERT(lock_count > 0);
|
||||||
lock_count++;
|
lock_count++;
|
||||||
|
@ -47,7 +47,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unlock() {
|
void Unlock() {
|
||||||
ASSERT(this->IsLockedByCurrentThread());
|
ASSERT(IsLockedByCurrentThread());
|
||||||
ASSERT(lock_count > 0);
|
ASSERT(lock_count > 0);
|
||||||
|
|
||||||
// Release an instance of the lock.
|
// Release an instance of the lock.
|
||||||
|
|
Loading…
Reference in a new issue