give each thread a unique name

This commit is contained in:
Marcel Märtens 2021-03-22 11:06:15 +01:00
parent f9720b9767
commit a945d83ac7
2 changed files with 20 additions and 10 deletions

View file

@ -912,9 +912,12 @@ impl Stream {
let (tx, rx) = trigger();
// Clone the handle for passing into worker thread.
let stream = inner.clone();
let thread = thread::spawn(move || {
input_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback);
});
let thread = thread::Builder::new()
.name("cpal_alsa_in".to_owned())
.spawn(move || {
input_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback);
})
.unwrap();
Stream {
thread: Some(thread),
inner,
@ -934,9 +937,12 @@ impl Stream {
let (tx, rx) = trigger();
// Clone the handle for passing into worker thread.
let stream = inner.clone();
let thread = thread::spawn(move || {
output_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback);
});
let thread = thread::Builder::new()
.name("cpal_alsa_out".to_owned())
.spawn(move || {
output_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback);
})
.unwrap();
Stream {
thread: Some(thread),
inner,