[PR #3021] [MERGED] Core: Pthread affinity fixups #3155

Closed
opened 2026-02-27 22:02:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3021
Author: @StevenMiller123
Created: 6/1/2025
Status: Merged
Merged: 6/3/2025
Merged by: @squidbus

Base: mainHead: affinity-fixups


📝 Commits (2)

  • 321e200 posix_pthread_attr_getschedparam
  • 874b87e Fixes for scePthreadGetAffinity and scePthreadSetAffinity

📊 Changes

2 files changed (+29 additions, -4 deletions)

View changed files

📝 src/core/libraries/kernel/threads/pthread.cpp (+27 -4)
📝 src/core/libraries/kernel/threads/pthread_attr.cpp (+2 -0)

📄 Description

In the pthread affinity functions, when thread != g_curthread, we should be using ThrState::FindThread to get and lock the appropriate thread. Adding this logic fixes a potential crash in scePthreadSetAffinity, helping Need for Speed™ Heat (CUSA15081) get slightly further.
I've also added an export for posix_pthread_attr_getschedparam, as it's used by Kingdom Come: Deliverance Royal Edition (CUSA15436).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3021 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 6/1/2025 **Status:** ✅ Merged **Merged:** 6/3/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `affinity-fixups` --- ### 📝 Commits (2) - [`321e200`](https://github.com/shadps4-emu/shadPS4/commit/321e2007b421aee4f19d494b8cffb224bead49a4) posix_pthread_attr_getschedparam - [`874b87e`](https://github.com/shadps4-emu/shadPS4/commit/874b87e2e3334d36afca2be7e540894c76ed03a0) Fixes for scePthreadGetAffinity and scePthreadSetAffinity ### 📊 Changes **2 files changed** (+29 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/threads/pthread.cpp` (+27 -4) 📝 `src/core/libraries/kernel/threads/pthread_attr.cpp` (+2 -0) </details> ### 📄 Description In the pthread affinity functions, when `thread != g_curthread`, we should be using `ThrState::FindThread` to get and lock the appropriate thread. Adding this logic fixes a potential crash in `scePthreadSetAffinity`, helping Need for Speed™ Heat (CUSA15081) get slightly further. I've also added an export for `posix_pthread_attr_getschedparam`, as it's used by Kingdom Come: Deliverance Royal Edition (CUSA15436). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3155
No description provided.