instrument: narrow the live-param publish lock to its own mutex, off the reload's decode

Knob-drag publishes no longer block behind a full reload's WAV decode — a dedicated livePublishMutex_ replaces reloadMutex_ for the seqlock's single-writer contract. Also fixes an editor comment overclaim and two doc restatements.
This commit is contained in:
2026-07-30 21:54:20 -04:00
parent bbc7dc70bb
commit efd1e41f46
6 changed files with 26 additions and 21 deletions
+6 -1
View File
@@ -154,7 +154,12 @@ std::string ReaSamplerProcessor::reloadInstrument() {
// frames the build resolved and a note-on with a live block sounds identical
// to one without.
sample.live = &liveParams_;
liveParams_.publish(instrument::engine::foldLive(sample.play));
{
// reloadMutex_ (held for this whole function) nests livePublishMutex_ here;
// publishLiveParams never holds reloadMutex_, so this is the only nesting.
std::lock_guard<std::mutex> lp(livePublishMutex_);
liveParams_.publish(instrument::engine::foldLive(sample.play));
}
builtSampleRate_.store(sample.sampleRate, std::memory_order_relaxed);
resolvedId = selId; // the concrete pick that resolved
}