Skip to content

Commit

Permalink
refactor(blocking): don't store thread handles
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil-prabhu committed Jan 3, 2025
1 parent 85ef142 commit ef89b1e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/blocking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,10 @@ pub fn detect(timeout: Option<u64>) -> Result<ProviderId> {
.lock()
.map_err(|_| anyhow::anyhow!("Error locking providers"))?;
let provider_entries: Vec<P> = guard.iter().cloned().collect();
let providers_count = provider_entries.len();
let mut handles = Vec::with_capacity(providers_count);

for provider in provider_entries {
let tx = tx.clone();
let handle = std::thread::spawn(move || provider.identify(tx, timeout));

handles.push(handle);
std::thread::spawn(move || provider.identify(tx, timeout));
}

match rx.recv_timeout(timeout) {
Expand Down

0 comments on commit ef89b1e

Please sign in to comment.