mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-02 19:08:03 -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 {
|
||||
|
||||
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;
|
||||
|
||||
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.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)) {
|
||||
new_thread->attr.flags |= PthreadAttrFlags::ScopeSystem;
|
||||
} else {
|
||||
|
||||
@ -24,6 +24,12 @@ class SymbolsResolver;
|
||||
|
||||
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;
|
||||
|
||||
enum class PthreadMutexFlags : u32 {
|
||||
|
||||
@ -24,9 +24,9 @@ static constexpr std::array<PthreadPrio, 3> ThrPriorities = {{
|
||||
}};
|
||||
|
||||
PthreadAttr PthreadAttrDefault = {
|
||||
.sched_policy = SchedPolicy::Fifo,
|
||||
.sched_inherit = 0,
|
||||
.prio = 0,
|
||||
.sched_policy = SchedPolicy::Other,
|
||||
.sched_inherit = PthreadInheritSched,
|
||||
.prio = ORBIS_KERNEL_PRIO_FIFO_DEFAULT,
|
||||
.suspend = false,
|
||||
.flags = PthreadAttrFlags::ScopeSystem,
|
||||
.stackaddr_attr = nullptr,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user