Of note, this is a logic/timing bug, and Rust would not have prevented this.