mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 14:48:46 +00:00
thread_management: Do not call createMutex on unlock
This commit is contained in:
parent
3c0e11f606
commit
a8713904b8
1 changed files with 1 additions and 7 deletions
|
@ -414,11 +414,6 @@ ScePthreadMutex* createMutex(ScePthreadMutex* addr) {
|
||||||
if (addr == nullptr || *addr != nullptr) {
|
if (addr == nullptr || *addr != nullptr) {
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
static std::mutex mutex;
|
|
||||||
std::scoped_lock lk{mutex};
|
|
||||||
if (*addr != nullptr) {
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
const VAddr vaddr = reinterpret_cast<VAddr>(addr);
|
const VAddr vaddr = reinterpret_cast<VAddr>(addr);
|
||||||
std::string name = fmt::format("mutex{:#x}", vaddr);
|
std::string name = fmt::format("mutex{:#x}", vaddr);
|
||||||
scePthreadMutexInit(addr, nullptr, name.c_str());
|
scePthreadMutexInit(addr, nullptr, name.c_str());
|
||||||
|
@ -584,8 +579,7 @@ int PS4_SYSV_ABI scePthreadMutexLock(ScePthreadMutex* mutex) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePthreadMutexUnlock(ScePthreadMutex* mutex) {
|
int PS4_SYSV_ABI scePthreadMutexUnlock(ScePthreadMutex* mutex) {
|
||||||
mutex = createMutex(mutex);
|
if (mutex == nullptr || *mutex == nullptr) {
|
||||||
if (mutex == nullptr) {
|
|
||||||
return SCE_KERNEL_ERROR_EINVAL;
|
return SCE_KERNEL_ERROR_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue