| 952 | } |
| 953 | |
| 954 | void write(const T& item) { |
| 955 | // Start the write. It may complete immediately if no IO was being waited on |
| 956 | Future<Void> w = write_impl(this, item); |
| 957 | // If it didn't complete immediately, then store the future in operation |
| 958 | if (!w.isReady()) { |
| 959 | writeOperations = writeOperations && w; |
| 960 | } |
| 961 | } |
| 962 | |
| 963 | // If readNext() cannot complete immediately because it must wait for IO, it will route to here. |
| 964 | // The purpose of this function is to serialize simultaneous readers on self while letting the |