[PR #3490] [MERGED] semaphore: Fix determining wait status when canceled/deleted #3512

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3490
Author: @squidbus
Created: 8/31/2025
Status: Merged
Merged: 8/31/2025
Merged by: @squidbus

Base: mainHead: fix-sem-delete


📝 Commits (1)

  • 025e8a2 semaphore: Fix determining wait status when canceled/deleted

📊 Changes

1 file changed (+37 additions, -37 deletions)

View changed files

📝 src/core/libraries/kernel/threads/semaphore.cpp (+37 -37)

📄 Description

Current logic for determining the result will always return ETIMEDOUT when not signaled, which causes the canceled and deleted statuses to get lost. In turn this can cause the main Wait function to erroneously try to remove the waiter from the wait list when it already has been and/or the semaphore has already been deleted.

Fix up the logic to make sure that these statuses are not ignored. Also, clean up some types to follow our standard here and fix a typo.


🔄 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/3490 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 8/31/2025 **Status:** ✅ Merged **Merged:** 8/31/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `fix-sem-delete` --- ### 📝 Commits (1) - [`025e8a2`](https://github.com/shadps4-emu/shadPS4/commit/025e8a28cee3563ce57af43d7805279b1ecd37fc) semaphore: Fix determining wait status when canceled/deleted ### 📊 Changes **1 file changed** (+37 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/threads/semaphore.cpp` (+37 -37) </details> ### 📄 Description Current logic for determining the result will always return `ETIMEDOUT` when not signaled, which causes the canceled and deleted statuses to get lost. In turn this can cause the main `Wait` function to erroneously try to remove the waiter from the wait list when it already has been and/or the semaphore has already been deleted. Fix up the logic to make sure that these statuses are not ignored. Also, clean up some types to follow our standard here and fix a typo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:58 +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#3512
No description provided.