Skip to content

Commit

Permalink
Name the diskbuffer thread (#540)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Laine <[email protected]>
  • Loading branch information
rkuris and Dan Laine authored Feb 20, 2024
1 parent 2e6480d commit 90aa00a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions firewood/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,14 @@ impl Db {
let disk_requester = DiskBufferRequester::new(sender);
let buffer = cfg.buffer.clone();
#[allow(clippy::unwrap_used)]
let disk_thread = block_in_place(|| {
Some(std::thread::spawn(move || {
let disk_buffer = DiskBuffer::new(inbound, &buffer, &wal).unwrap();
disk_buffer.run()
}))
});
let disk_buffer = DiskBuffer::new(inbound, &buffer, &wal).expect("DiskBuffer::new");

let disk_thread = Some(
std::thread::Builder::new()
.name("DiskBuffer".to_string())
.spawn(move || disk_buffer.run())
.expect("thread spawn should succeed"),
);

#[allow(clippy::unwrap_used)]
let root_hash_cache: Arc<CachedSpace> = CachedSpace::new(
Expand Down

0 comments on commit 90aa00a

Please sign in to comment.