mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 16:25:58 +03:00
[PR #710] [CLOSED] Make AvPlayerQueue size atomic #1730
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#1730
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/710
Author: @OFFTKP
Created: 9/1/2024
Status: ❌ Closed
Base:
main← Head:as📝 Commits (1)
0be9ebcMake AvPlayerQueue size atomic📊 Changes
1 file changed (+8 additions, -1 deletions)
View changed files
📝
src/core/libraries/avplayer/avplayer_common.h(+8 -1)📄 Description
std::queue::size is not thread safe, and also
doesn't look thread safe, because the Size() == 0 check can be false, but before the mutex is locked a different thread pops an element or clears the queue making size 0, which leads to UB
Added another size check after locking the mutex instead of locking it at the start of the function, so that Pop doesn't unconditionally lock but it also doesn't try to pop from an empty queue
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.