SIGN IN SIGN UP

Add two-step write feature to bytebuf

If there is exactly one producer, then it can assume that the remaining
space in the buffer will only increase until it writes something.

This assumption may allow the producer to write to the buffer (up to a
known safe size) without any synchronization mechanism, thus allowing
to read and write different parts of the buffer in parallel.

The producer can then commit the write with a lock held, and update its
knowledge of the safe empty remaining space.

PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
R
Romain Vimont committed
b60a8aa657f62a596e528f244f1c101dc2f054b7
Parent: 20d41fd