diff --git a/repro-problem/src/main.rs b/repro-problem/src/main.rs index b029850d84..d68c34c39c 100644 --- a/repro-problem/src/main.rs +++ b/repro-problem/src/main.rs @@ -8,19 +8,21 @@ mod virtual_file; async fn main() { page_cache::init(10); - let cache = page_cache::get(); + tokio::spawn(async move { + let cache = page_cache::get(); - let res = cache - .read_immutable_buf(page_cache::next_file_id(), 0) - .await - .unwrap(); - match res { - page_cache::ReadBufResult::Found(found) => todo!(), - page_cache::ReadBufResult::NotFound(write_guard) => { - let file = VirtualFile::open(camino::Utf8Path::new("foo")) - .await - .unwrap(); - file.read_exact_at(write_guard, 0).await; + let res = cache + .read_immutable_buf(page_cache::next_file_id(), 0) + .await + .unwrap(); + match res { + page_cache::ReadBufResult::Found(found) => todo!(), + page_cache::ReadBufResult::NotFound(write_guard) => { + let file = VirtualFile::open(camino::Utf8Path::new("foo")) + .await + .unwrap(); + file.read_exact_at(write_guard, 0).await; + } } - } + }); }