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:
Brandon Strong
2026-09-02 16:58:38 -07:00
committed by GitHub
parent 8f6f65f4c9
commit 16ea36eb4b
2 changed files with 18 additions and 0 deletions
+15
View File
@@ -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;
}
+3
View File
@@ -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);