Skip to content

Commit 7a3fa34

Browse files
committed
Give the router proxy thread a name
This makes debugging easier when panics occur inside the thread. Signed-off-by: Simon Wülker <[email protected]>
1 parent b10727a commit 7a3fa34

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/ipc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<'de> Deserialize<'de> for IpcSharedMemory {
581581
|os_ipc_shared_memory_regions_for_deserialization| {
582582
let mut regions = os_ipc_shared_memory_regions_for_deserialization.borrow_mut();
583583
let Some(region) = regions.get_mut(index) else {
584-
return Err(format!("Cannot consume shared memory region {index}, there are only {} regions available", regions.len()));
584+
return Err(format!("Cannot consume shared memory region at index {index}, there are only {} regions available", regions.len()));
585585
};
586586

587587
region.take().ok_or_else(|| format!("Shared memory region {index} has already been consumed"))

src/router.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ impl RouterProxy {
4747
// Router proxy takes both sending ends.
4848
let (msg_sender, msg_receiver) = crossbeam_channel::unbounded();
4949
let (wakeup_sender, wakeup_receiver) = ipc::channel().unwrap();
50-
thread::spawn(move || Router::new(msg_receiver, wakeup_receiver).run());
50+
thread::Builder::new()
51+
.name("router-proxy".to_string())
52+
.spawn(move || Router::new(msg_receiver, wakeup_receiver).run())
53+
.expect("Failed to spawn router proxy thread");
5154
RouterProxy {
5255
comm: Mutex::new(RouterProxyComm {
5356
msg_sender,

0 commit comments

Comments
 (0)