cleanup createMutex
This commit is contained in:
parent
8f8f0757af
commit
f3c189feb3
|
@ -123,6 +123,17 @@ int PS4_SYSV_ABI scePthreadAttrSetschedpolicy(ScePthreadAttr* attr, int policy)
|
||||||
/****
|
/****
|
||||||
* Mutex calls
|
* Mutex calls
|
||||||
*/
|
*/
|
||||||
|
void* createMutex(void* addr) {
|
||||||
|
if (addr == nullptr || *static_cast<ScePthreadMutex*>(addr) != nullptr) {
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
auto vaddr = reinterpret_cast<u64>(addr);
|
||||||
|
|
||||||
|
std::string name = fmt::format("mutex{:#x}", vaddr);
|
||||||
|
scePthreadMutexInit(static_cast<ScePthreadMutex*>(addr), nullptr, name.c_str());
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePthreadMutexInit(ScePthreadMutex* mutex, const ScePthreadMutexattr* attr, const char* name) {
|
int PS4_SYSV_ABI scePthreadMutexInit(ScePthreadMutex* mutex, const ScePthreadMutexattr* attr, const char* name) {
|
||||||
PRINT_FUNCTION_NAME();
|
PRINT_FUNCTION_NAME();
|
||||||
if (mutex == nullptr) {
|
if (mutex == nullptr) {
|
||||||
|
@ -154,17 +165,6 @@ int PS4_SYSV_ABI scePthreadMutexInit(ScePthreadMutex* mutex, const ScePthreadMut
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* createMutex(void* addr) {
|
|
||||||
if (addr == nullptr || *static_cast<void**>(addr) != nullptr) {
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
auto vaddr = reinterpret_cast<u64>(addr);
|
|
||||||
|
|
||||||
std::string name = fmt::format("mutex{:#}", vaddr);
|
|
||||||
scePthreadMutexInit(static_cast<ScePthreadMutex*>(addr), nullptr, name.c_str());
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePthreadMutexattrInit(ScePthreadMutexattr* attr) {
|
int PS4_SYSV_ABI scePthreadMutexattrInit(ScePthreadMutexattr* attr) {
|
||||||
*attr = new PthreadMutexattrInternal{};
|
*attr = new PthreadMutexattrInternal{};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue