Files
nearby/internal/platform
Janusz Sobczak a7a3eb8a92 Use consistent return value in Pipe read.
Previously reading from an empty, closed Pipe returned:
* IO exception if there were no writes to the pipe,
* Empty byte array if there were writes to the pipe.
With this change, we return an empty byte array on both paths.

This also fixes a subtle race condition in the following flow:
1. Pipe is empty
2. Thread A is reading from the pipe (blocking call).
3. Thread B writes to the pipe and immediately closes it.
4. Thread A is unblocked and returns IO error. The data written by thread B is
   ignored!

The new test in bluetooth_classic_test triggered that defect consistently.

PiperOrigin-RevId: 518107700
2023-03-20 16:26:52 -07:00
..
2023-03-16 13:27:26 -07:00
2023-03-06 07:06:57 -08:00
2023-01-23 16:04:21 -08:00
2023-03-15 17:24:11 -07:00
2022-02-02 11:56:39 -08:00
2023-03-16 13:27:26 -07:00
2022-02-02 11:56:39 -08:00
2023-03-15 18:42:39 -07:00
2023-01-11 15:19:33 -08:00
2022-02-02 11:56:39 -08:00