9ea4446369
The final write from the writer thread does not require a lock: it is guaranteed that enough space is available since the reader thread never writes.