kernel: fix the macOS build of host thread naming #1122
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1122
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1122/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Nawid3333 on GitHub · 2026-10-06 20:10 UTC · original
Nawid3333:fix/macos-pthread-setname→main· +4 −0 · 1 files · 4 commits · merged 2026-10-06 21:18 UTCProblem
Since
199d0a9d(#1106, "kernel: name guest threads on the host") the macOS build fails onmain, and with it in the macOS job of PRs that CI builds on top ofmain(for example #1111 and #1112):main's own run: https://github.com/KytyPS5/KytyPS5/actions/runs/37521148237/job/112470552357Cause
The new call is guarded by
#if KYTY_PLATFORM == KYTY_PLATFORM_LINUX, but CMake setsKYTY_PLATFORM_LINUXfor macOS as well (CMakeLists.txt), which is why the rest ofpthread.cppseparates Apple with__APPLE__. glibc'spthread_setname_np(pthread_t, const char*)takes the thread and the name; Apple'spthread_setname_np(const char*)takes only the name and always renames the calling thread.Fix
On Apple, use the one-argument form. This code runs on the new thread itself (it passes
pthread_self()on Linux), so renaming the calling thread names the right thread. Apple allows up to 63 characters plus the terminator, so the name is cut at 63 there; the Linux call is unchanged (15 characters).The first commit is only the repository's pre-commit clang-format hook output for
pthread.cpp(21 lines, no code change); the fix itself is the second commit (+4 lines).Testing
kyty_emulator: builds; the change is inside the Linux/macOS-only block.AI use (per the README's AI policy): Claude (Anthropic) traced the failing macOS job to the platform macro, wrote the change and ran the builds above. I reviewed the change before marking this PR ready.
🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-10-06 20:53 UTC · original · edited 2026-10-06 21:04 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
b5a89902-0259-4c2b-9f75-9e794e627a5a📥 Commits
Reviewing files that changed from the base of the PR and between
199d0a9d92and17138cbf35.📒 Files selected for processing (1)
src/kernel/pthread.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
The change reformats the
PthreadPrivateandPthreadCondPrivatemember declarations without changing their fields or order. On macOS,RunThreaduses the one-argumentpthread_setname_npform and truncates names to 63 characters. Other Linux builds continue to use the two-argument form and a 15-character limit.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
17138The macOS build fix uses the platform-specific thread-naming call. Behavioral naming tests were not reported, but no actionable merge-blocking risk is established.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.