mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 03:54:45 +00:00
Thread_management rework
Only error Left: /home/naomi/Asztal/shadPS4/GitHub/shadPS4/src/core/libraries/kernel/thread_management.cpp: In function ‘int Libraries::Kernel::scePthreadAttrGetstackaddr(PthreadAttrInternal* const*, void**)’: /home/naomi/Asztal/shadPS4/GitHub/shadPS4/src/core/libraries/kernel/thread_management.cpp:321:43: warning: ‘int pthread_attr_getstackaddr(const pthread_attr_t*, void**)’ is deprecated [-Wdeprecated-declarations] 321 | int result = pthread_attr_getstackaddr(&(*attr)->pth_attr, stack_addr); | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/gthr-default.h:35, from /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/gthr.h:157, from /usr/include/c++/14.1.1/bits/std_mutex.h:41, from /usr/include/c++/14.1.1/mutex:47, from /home/naomi/Asztal/shadPS4/GitHub/shadPS4/src/core/libraries/kernel/thread_management.cpp:4: /usr/include/pthread.h:353:12: note: declared here 353 | extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict /usr/bin/ld: CMakeFiles/shadps4.dir/src/core/libraries/kernel/thread_management.cpp.o: in function `Libraries::Kernel::scePthreadAttrGetstackaddr(Libraries::Kernel::PthreadAttrInternal* const*, void**)': thread_management.cpp:(.text+0x38b): warning: the use of `pthread_attr_getstackaddr' is deprecated, use `pthread_attr_getstack'
This commit is contained in:
parent
e2019ea99a
commit
a5b3967fd2
1 changed files with 15 additions and 1 deletions
|
@ -323,6 +323,7 @@ int PS4_SYSV_ABI scePthreadAttrGetstackaddr(const ScePthreadAttr* attr, void** s
|
|||
return result == 0 ? SCE_OK : SCE_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
|
||||
int PS4_SYSV_ABI scePthreadAttrGetstacksize(const ScePthreadAttr* attr, size_t* stack_size) {
|
||||
|
||||
if (stack_size == nullptr || attr == nullptr || *attr == nullptr) {
|
||||
|
@ -334,6 +335,7 @@ int PS4_SYSV_ABI scePthreadAttrGetstacksize(const ScePthreadAttr* attr, size_t*
|
|||
return result == 0 ? SCE_OK : SCE_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
int PS4_SYSV_ABI scePthreadAttrSetstackaddr(ScePthreadAttr* attr, void* addr) {
|
||||
|
||||
if (addr == nullptr || attr == nullptr || *attr == nullptr) {
|
||||
|
@ -343,6 +345,18 @@ int PS4_SYSV_ABI scePthreadAttrSetstackaddr(ScePthreadAttr* attr, void* addr) {
|
|||
int result = pthread_attr_setstackaddr(&(*attr)->pth_attr, addr);
|
||||
|
||||
return result == 0 ? SCE_OK : SCE_KERNEL_ERROR_EINVAL;
|
||||
}*/
|
||||
int PS4_SYSV_ABI scePthreadAttrSetstackaddr(ScePthreadAttr* attr, void* stack_addr, size_t stack_size) {
|
||||
if (attr == nullptr || *attr == nullptr || stack_addr == nullptr) {
|
||||
return SCE_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
int result = pthread_attr_setstack(&(*attr)->pth_attr, stack_addr, stack_size);
|
||||
if (result != 0) {
|
||||
return SCE_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePthreadAttrSetstacksize(ScePthreadAttr* attr, size_t stack_size) {
|
||||
|
@ -897,7 +911,7 @@ static int pthread_copy_attributes(ScePthreadAttr* dst, const ScePthreadAttr* sr
|
|||
result = (result == 0 ? scePthreadAttrSetschedparam(dst, ¶m) : result);
|
||||
result = (result == 0 ? scePthreadAttrSetschedpolicy(dst, policy) : result);
|
||||
if (stack_addr != nullptr) {
|
||||
result = (result == 0 ? scePthreadAttrSetstackaddr(dst, stack_addr) : result);
|
||||
result = (result == 0 ? scePthreadAttrSetstackaddr(dst, stack_addr, stack_size) : result);
|
||||
}
|
||||
if (stack_size != 0) {
|
||||
result = (result == 0 ? scePthreadAttrSetstacksize(dst, stack_size) : result);
|
||||
|
|
Loading…
Add table
Reference in a new issue