v1.4.0 release: live-coding scratch editor, interpreted Graph DSL, ClosureSynthesizer + SampleLoop

This commit is contained in:
2026-07-20 10:02:49 -07:00
parent 560724d116
commit 38d2107f64
104 changed files with 14471 additions and 105 deletions
@@ -76,8 +76,8 @@ struct AutoFreeOnDoneTests {
/// Drive engine.processBlock in tight bursts so engine-time runs many
/// multiples of wall-time. Same pattern as `LyrebirdEventListTests`.
private final class TestBlockDriver: @unchecked Sendable {
private var _thread: Thread?
private let _running: Atomic<Bool> = Atomic<Bool>(false)
private let _done: DispatchSemaphore = DispatchSemaphore(value: 0)
private let _engine: SynthesisEngine
private static let blocksPerBurst: Int = 32
private static let wallSleepSeconds: TimeInterval = 0.001
@@ -91,12 +91,17 @@ struct AutoFreeOnDoneTests {
}
Thread.sleep(forTimeInterval: Self.wallSleepSeconds)
}
self._done.signal()
}
thread.qualityOfService = .userInteractive
thread.start()
_thread = thread
}
func stop() { _running.store(false, ordering: .relaxed) }
/// Stop and **join** the pump thread so no `processBlock` runs after
/// `stop()` returns to race the engine's own `stop()`. Idempotent.
func stop() {
guard _running.exchange(false, ordering: .relaxed) else { return }
_done.wait()
}
}
// MARK: - Tests