mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
libkernel: register scePthreadRwlockTryrdlock and the timed rwlock variants (#472)
* libkernel: register scePthreadRwlockTryrdlock and the timed rwlock variants * fix: initialize static rwlocks in newly registered APIs --------- Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
@@ -2573,6 +2573,11 @@ int KYTY_SYSV_ABI PthreadRwlockRdlock(PthreadRwlock* rwlock) {
|
||||
int KYTY_SYSV_ABI PthreadRwlockTimedrdlock(PthreadRwlock* rwlock, KernelUseconds usec) {
|
||||
PRINT_NAME();
|
||||
|
||||
auto* pthread_static_objects = g_pthread_context->GetPthreadStaticObjects();
|
||||
|
||||
rwlock = static_cast<PthreadRwlock*>(
|
||||
pthread_static_objects->CreateObject(rwlock, PthreadStaticObject::Type::Rwlock));
|
||||
|
||||
if (rwlock == nullptr) {
|
||||
return KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
@@ -2585,6 +2590,11 @@ int KYTY_SYSV_ABI PthreadRwlockTimedrdlock(PthreadRwlock* rwlock, KernelUseconds
|
||||
int KYTY_SYSV_ABI PthreadRwlockTimedwrlock(PthreadRwlock* rwlock, KernelUseconds usec) {
|
||||
PRINT_NAME();
|
||||
|
||||
auto* pthread_static_objects = g_pthread_context->GetPthreadStaticObjects();
|
||||
|
||||
rwlock = static_cast<PthreadRwlock*>(
|
||||
pthread_static_objects->CreateObject(rwlock, PthreadStaticObject::Type::Rwlock));
|
||||
|
||||
if (rwlock == nullptr) {
|
||||
return KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
@@ -2597,6 +2607,11 @@ int KYTY_SYSV_ABI PthreadRwlockTimedwrlock(PthreadRwlock* rwlock, KernelUseconds
|
||||
int KYTY_SYSV_ABI PthreadRwlockTryrdlock(PthreadRwlock* rwlock) {
|
||||
PRINT_NAME();
|
||||
|
||||
auto* pthread_static_objects = g_pthread_context->GetPthreadStaticObjects();
|
||||
|
||||
rwlock = static_cast<PthreadRwlock*>(
|
||||
pthread_static_objects->CreateObject(rwlock, PthreadStaticObject::Type::Rwlock));
|
||||
|
||||
if (rwlock == nullptr) {
|
||||
return KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
@@ -3227,6 +3227,9 @@ LIB_DEFINE(InitLibKernel_1_Pthread) {
|
||||
LIB_FUNC("mqdNorrB+gI", LibKernel::PthreadRwlockWrlock);
|
||||
LIB_FUNC("sIlRvQqsN2Y", LibKernel::PthreadRwlockWrlock);
|
||||
LIB_FUNC("bIHoZCTomsI", LibKernel::PthreadRwlockTrywrlock);
|
||||
LIB_FUNC("XD3mDeybCnk", LibKernel::PthreadRwlockTryrdlock);
|
||||
LIB_FUNC("iPtZRWICjrM", LibKernel::PthreadRwlockTimedrdlock);
|
||||
LIB_FUNC("adh--6nIqTk", LibKernel::PthreadRwlockTimedwrlock);
|
||||
LIB_FUNC("i2ifZ3fS2fo", LibKernel::PthreadRwlockattrDestroy);
|
||||
LIB_FUNC("yOfGg-I1ZII", LibKernel::PthreadRwlockattrInit);
|
||||
LIB_FUNC("qsdmgXjqSgk", LibKernel::PthreadRwlockattrDestroy);
|
||||
|
||||
Reference in New Issue
Block a user