diff --git a/cros_async/src/blocking/pool.rs b/cros_async/src/blocking/pool.rs index 50aa265601..d63bf6661b 100644 --- a/cros_async/src/blocking/pool.rs +++ b/cros_async/src/blocking/pool.rs @@ -96,7 +96,12 @@ impl Inner { let entry = state.worker_threads.vacant_entry(); let idx = entry.key(); let inner = self.clone(); - entry.insert(thread::spawn(move || run_blocking_thread(idx, inner))); + entry.insert( + thread::Builder::new() + .name(format!("blockingPool{}", idx)) + .spawn(move || run_blocking_thread(idx, inner)) + .unwrap(), + ); } } else { // We have idle threads, wake one up. diff --git a/cros_async/src/executor.rs b/cros_async/src/executor.rs index b25057795e..56860f81b9 100644 --- a/cros_async/src/executor.rs +++ b/cros_async/src/executor.rs @@ -50,7 +50,7 @@ pub(crate) fn async_poll_from<'a, F: IntoAsync + Send + 'a>( /// // Write all bytes from `data` to `f`. /// async fn write_file(f: &dyn IoSourceExt, mut data: Vec) -> AsyncResult<()> { /// while data.len() > 0 { -/// let (count, mut buf) = f.write_from_vec(0, data).await?; +/// let (count, mut buf) = f.write_from_vec(None, data).await?; /// /// data = buf.split_off(count); /// } @@ -68,7 +68,7 @@ pub(crate) fn async_poll_from<'a, F: IntoAsync + Send + 'a>( /// /// while rem > 0 { /// let buf = vec![0u8; min(rem, CHUNK_SIZE)]; -/// let (count, mut data) = from.read_to_vec(0, buf).await?; +/// let (count, mut data) = from.read_to_vec(None, buf).await?; /// /// if count == 0 { /// // End of file. Return the number of bytes transferred.