scePthreadSetprio, scePthreadGetprio

This commit is contained in:
raziel1000 2024-07-04 02:22:43 -06:00
parent e22ad65e70
commit bdcadf63d2
2 changed files with 12 additions and 0 deletions

View File

@ -1289,6 +1289,15 @@ int PS4_SYSV_ABI scePthreadGetthreadid() {
return (int)(size_t)g_pthread_self;
}
int PS4_SYSV_ABI scePthreadGetprio(ScePthread thread, int* prio) {
*prio = thread->prio;
return ORBIS_OK;
}
int PS4_SYSV_ABI scePthreadSetprio(ScePthread thread, int prio) {
thread->prio = prio;
return ORBIS_OK;
}
void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("lZzFeSxPl08", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_setcancelstate);
LIB_FUNCTION("0TyVk4MSLt0", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_cond_init);
@ -1310,6 +1319,8 @@ void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("7Xl257M4VNI", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_equal);
LIB_FUNCTION("h9CcP3J0oVM", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_join);
LIB_FUNCTION("EI-5-jlq2dE", "libkernel", 1, "libkernel", 1, 1, scePthreadGetthreadid);
LIB_FUNCTION("1tKyG7RlMJo", "libkernel", 1, "libkernel", 1, 1, scePthreadGetprio);
LIB_FUNCTION("W0Hpm2X0uPE", "libkernel", 1, "libkernel", 1, 1, scePthreadSetprio);
LIB_FUNCTION("aI+OeCz8xrQ", "libkernel", 1, "libkernel", 1, 1, scePthreadSelf);
LIB_FUNCTION("EotR8a3ASf4", "libkernel", 1, "libkernel", 1, 1, posix_pthread_self);

View File

@ -58,6 +58,7 @@ struct PthreadInternal {
std::atomic_bool is_free;
using Destructor = std::pair<OrbisPthreadKey, PthreadKeyDestructor>;
std::vector<Destructor> key_destructors;
int prio;
};
struct PthreadAttrInternal {