mirror of
https://github.com/sbt/sbt.git
synced 2026-09-05 17:25:23 +02:00
**Problem** Four fields hold a closeable that a later caller replaces. Each one reads the field, closes what it finds and writes the new value in its own way. **Solution** AtomicCloseable holds such a value. It closes the value it replaces, and closes the value that loses a race to fill an empty field. Two things change for a caller. The client replaced its session without closing the one it dropped, and now closes it. A close that throws no longer escapes: each of these sites is discarding the value it closes, and whatever led there matters more than the close. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>