mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-31 14:35:19 +00:00
Handle empty mutex attribute
- scePthreadMutexInit did not return default when the mutex attributes were empty, now it does
This commit is contained in:
parent
ea4ae56f4d
commit
4e54f054d6
@ -421,13 +421,17 @@ ScePthreadMutex* createMutex(ScePthreadMutex* addr) {
|
|||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePthreadMutexInit(ScePthreadMutex* mutex, const ScePthreadMutexattr* attr,
|
int PS4_SYSV_ABI scePthreadMutexInit(ScePthreadMutex* mutex, const ScePthreadMutexattr* mutex_attr,
|
||||||
const char* name) {
|
const char* name) {
|
||||||
|
const ScePthreadMutexattr* attr;
|
||||||
|
|
||||||
if (mutex == nullptr) {
|
if (mutex == nullptr) {
|
||||||
return SCE_KERNEL_ERROR_EINVAL;
|
return SCE_KERNEL_ERROR_EINVAL;
|
||||||
}
|
}
|
||||||
if (attr == nullptr) {
|
if (mutex_attr == nullptr || *mutex_attr == nullptr) {
|
||||||
attr = g_pthread_cxt->getDefaultMutexattr();
|
attr = g_pthread_cxt->getDefaultMutexattr();
|
||||||
|
} else {
|
||||||
|
attr = mutex_attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
*mutex = new PthreadMutexInternal{};
|
*mutex = new PthreadMutexInternal{};
|
||||||
|
Loading…
Reference in New Issue
Block a user