mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-06 08:15:00 -06:00
Fix default pthread attributes (#3987)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This matches libkernel decomp + old fpPS4 code. Fixes Attack On Titan 2 audio
This commit is contained in:
parent
9144b29742
commit
d3c6abac4e
@ -14,12 +14,6 @@
|
|||||||
|
|
||||||
namespace Libraries::Kernel {
|
namespace Libraries::Kernel {
|
||||||
|
|
||||||
constexpr int PthreadInheritSched = 4;
|
|
||||||
|
|
||||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_DEFAULT = 700;
|
|
||||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_HIGHEST = 256;
|
|
||||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_LOWEST = 767;
|
|
||||||
|
|
||||||
extern PthreadAttr PthreadAttrDefault;
|
extern PthreadAttr PthreadAttrDefault;
|
||||||
|
|
||||||
void _thread_cleanupspecific();
|
void _thread_cleanupspecific();
|
||||||
@ -231,7 +225,7 @@ int PS4_SYSV_ABI posix_pthread_create_name_np(PthreadT* thread, const PthreadAtt
|
|||||||
new_thread->attr = *(*attr);
|
new_thread->attr = *(*attr);
|
||||||
new_thread->attr.cpusetsize = 0;
|
new_thread->attr.cpusetsize = 0;
|
||||||
}
|
}
|
||||||
if (new_thread->attr.sched_inherit == PthreadInheritSched) {
|
if (curthread != nullptr && new_thread->attr.sched_inherit == PthreadInheritSched) {
|
||||||
if (True(curthread->attr.flags & PthreadAttrFlags::ScopeSystem)) {
|
if (True(curthread->attr.flags & PthreadAttrFlags::ScopeSystem)) {
|
||||||
new_thread->attr.flags |= PthreadAttrFlags::ScopeSystem;
|
new_thread->attr.flags |= PthreadAttrFlags::ScopeSystem;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -24,6 +24,12 @@ class SymbolsResolver;
|
|||||||
|
|
||||||
namespace Libraries::Kernel {
|
namespace Libraries::Kernel {
|
||||||
|
|
||||||
|
constexpr int PthreadInheritSched = 4;
|
||||||
|
|
||||||
|
constexpr int ORBIS_KERNEL_PRIO_FIFO_DEFAULT = 700;
|
||||||
|
constexpr int ORBIS_KERNEL_PRIO_FIFO_HIGHEST = 256;
|
||||||
|
constexpr int ORBIS_KERNEL_PRIO_FIFO_LOWEST = 767;
|
||||||
|
|
||||||
struct Pthread;
|
struct Pthread;
|
||||||
|
|
||||||
enum class PthreadMutexFlags : u32 {
|
enum class PthreadMutexFlags : u32 {
|
||||||
|
|||||||
@ -24,9 +24,9 @@ static constexpr std::array<PthreadPrio, 3> ThrPriorities = {{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
PthreadAttr PthreadAttrDefault = {
|
PthreadAttr PthreadAttrDefault = {
|
||||||
.sched_policy = SchedPolicy::Fifo,
|
.sched_policy = SchedPolicy::Other,
|
||||||
.sched_inherit = 0,
|
.sched_inherit = PthreadInheritSched,
|
||||||
.prio = 0,
|
.prio = ORBIS_KERNEL_PRIO_FIFO_DEFAULT,
|
||||||
.suspend = false,
|
.suspend = false,
|
||||||
.flags = PthreadAttrFlags::ScopeSystem,
|
.flags = PthreadAttrFlags::ScopeSystem,
|
||||||
.stackaddr_attr = nullptr,
|
.stackaddr_attr = nullptr,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user