fixed thread race in SoundTrackWriter#32980
fixed thread race in SoundTrackWriter#32980igorkorsukov wants to merge 1 commit intomusescore:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn SoundTrackWriter::write(), the deferred cleanup no longer calls the audio engine and source setters directly. Teardown actions—setting render mode to IdleMode, resetting the source output spec, and deactivating the source—are wrapped in an IAudioEngine::Operation lambda and executed via audioEngine()->execOperation(OperationType::LongOperation, func). m_isAborted is still reset prior to these teardown actions. 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/framework/audio/engine/internal/export/soundtrackwriter.cpp`:
- Around line 107-117: Move the abort-flag reset so it occurs after the
synchronized teardown via execOperation: currently m_isAborted is cleared before
calling audioEngine()->execOperation, which can race with abort() and leak into
the next write(); instead clear m_isAborted only after execOperation completes
(i.e., after the lambda that calls audioEngine()->setMode(RenderMode::IdleMode),
m_source->setOutputSpec(...) and m_source->setIsActive(false) has finished
executing) so that the flag can't be re-set by abort() while the engine teardown
is in progress.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a85ef522-44c9-4758-80fa-c5deec734c2e
📒 Files selected for processing (1)
src/framework/audio/engine/internal/export/soundtrackwriter.cpp
src/framework/audio/engine/internal/export/soundtrackwriter.cpp
Outdated
Show resolved
Hide resolved
6b6ff42 to
a4c456c
Compare
No description provided.