[Mutex] Make less dumb

This commit is contained in:
wheremyfoodat 2023-04-21 21:48:07 +03:00
parent 91e008ad1d
commit 2ebbb08766
2 changed files with 1 additions and 2 deletions

View file

@ -177,7 +177,7 @@ struct Mutex {
u32 lockCount; // Number of times this mutex has been locked by its daddy. 0 = not locked
bool locked;
Mutex(bool lock = false) : locked(lock), waitlist(0), lockCount(0) {}
Mutex(bool lock = false) : locked(lock), waitlist(0), lockCount(lock ? 1 : 0) {}
};
struct Semaphore {

View file

@ -169,7 +169,6 @@ Handle Kernel::makeMutex(bool locked) {
if (locked) {
Mutex* moo = objects[ret].getData<Mutex>();
moo->ownerThread = currentThreadIndex;
moo->lockCount = 1;
}
return ret;