Skip to content

Commit

Permalink
Remove unnecessary code guaranteed by the Drop implementation of th…
Browse files Browse the repository at this point in the history
…e dropped value
  • Loading branch information
nazar-pc committed Dec 9, 2024
1 parent e4a1210 commit a526b68
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ where
let listener = event.listen();

if let Some(thread_pool_pair) = mutex.lock().pop() {
drop(listener);
// It is possible that we got here because there was the last free pair available
// and in the meantime listener received notification. Just in case that was the
// case, notify one more listener (if there is any) to make sure all available
// thread pools are utilized when there is demand for them.
event.notify(1);
break thread_pool_pair;
}

Expand Down
6 changes: 0 additions & 6 deletions crates/subspace-farmer/src/thread_pool_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ impl PlottingThreadPoolManager {
let listener = event.listen();

if let Some(thread_pool_pair) = mutex.lock().thread_pool_pairs.pop() {
drop(listener);
// It is possible that we got here because there was the last free pair available
// and in the meantime listener received notification. Just in case that was the
// case, notify one more listener (if there is any) to make sure all available
// thread pools are utilized when there is demand for them.
event.notify(1);
break thread_pool_pair;
}

Expand Down

0 comments on commit a526b68

Please sign in to comment.