[PR #327] [MERGED] semaphore: Yet another race condition fix #1485

Closed
opened 2026-02-27 21:12:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/327
Author: @raphaelthegreat
Created: 7/26/2024
Status: Merged
Merged: 7/27/2024
Merged by: @raphaelthegreat

Base: mainHead: sem-race


📝 Commits (1)

  • 2bea573 semaphore: Yet another race condition fix

📊 Changes

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

View changed files

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

📄 Description

The waiting thread object could be destructed before the scoped lock would go out of scope leaving the mutex in an undefined state. With this change we use the global lock for sleeping threads. This means that if a Signal call wakes up multiple threads, the threads will wait until the Signal is done before waking up


🔄 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/327 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 7/26/2024 **Status:** ✅ Merged **Merged:** 7/27/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `sem-race` --- ### 📝 Commits (1) - [`2bea573`](https://github.com/shadps4-emu/shadPS4/commit/2bea573ea8e00eceb150d83c26bd5bcd43b9c4fb) semaphore: Yet another race condition fix ### 📊 Changes **1 file changed** (+1 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/threads/semaphore.cpp` (+1 -4) </details> ### 📄 Description The waiting thread object could be destructed before the scoped lock would go out of scope leaving the mutex in an undefined state. With this change we use the global lock for sleeping threads. This means that if a Signal call wakes up multiple threads, the threads will wait until the Signal is done before waking up --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:12:46 +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#1485
No description provided.