Conversation
- PlayQueueManager.playNext(): check()를 mutex 내부로 이동하여 check와 실행 사이 경쟁 조건 제거 - AudioFocusManager: wasPlayingBeforeTransientLoss, wasDucked 필드에 @volatile 추가로 콜백 스레드 가시성 보장
Coverage Report
|
There was a problem hiding this comment.
Pull request overview
재생 큐 전환과 오디오 포커스 처리에서 발생할 수 있는 동시성(TOCTOU/가시성) 문제를 줄여 재생 제어의 안정성을 높이려는 PR입니다.
Changes:
PlayQueueManager.playNext()에서 검증(check)을 mutex 내부로 이동해 검증-실행 사이 경쟁 조건을 제거AudioFocusManager의 포커스 상태 보조 플래그(wasPlayingBeforeTransientLoss,wasDucked)에@Volatile을 추가해 콜백 스레드에서의 가시성 보강
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/src/main/java/com/happyseal/zenplayer/features/player/data/PlayQueueManager.kt | playNext()의 TOCTOU 가능성을 줄이기 위해 락 범위 조정 |
| app/src/main/java/com/happyseal/zenplayer/features/player/data/AudioFocusManager.kt | 오디오 포커스 콜백 스레드 간 플래그 가시성 개선을 위한 @Volatile 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/src/main/java/com/happyseal/zenplayer/features/player/data/PlayQueueManager.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/happyseal/zenplayer/features/player/data/AudioFocusManager.kt
Show resolved
Hide resolved
- PlayQueueManager: playNext()에서 락 안에 suspend 함수 직접 호출 시 교착 가능성 제거 - computeNextAction()으로 분리하여 상태 변경은 락 안에서, emit/play는 락 밖에서 실행 - AudioFocusManager: currentFocusState에 @volatile 추가하여 스레드 간 가시성 보장
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PlayQueueManager.playNext():check()를playlistMutex.withLock내부로 이동하여 검증과 실행 사이의 경쟁 조건(TOCTOU) 제거AudioFocusManager:wasPlayingBeforeTransientLoss,wasDucked필드에@Volatile추가로 오디오 포커스 콜백 스레드에서의 가시성 보장변경 파일
features/player/data/PlayQueueManager.ktfeatures/player/data/AudioFocusManager.kt