Skip to content

Commit

Permalink
Hold cleanup handle in producer threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
porcuquine committed Oct 10, 2020
1 parent 82f2529 commit d2e337f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,8 @@ fn create_layer_labels(
// This could fail, but we will ignore the error if so.
// It will be logged as a warning by `bind_core`.
debug!("binding core in producer thread {}", i);
if let Some(&core_index) = core_index {
let _ = bind_core(core_index);
}
// When `_cleanup_handle` is dropped, the previous binding of thread will be restored.
let _cleanup_handle = core_index.map(|c| bind_core(*c));

create_label_runner(
parents_cache,
Expand Down

0 comments on commit d2e337f

Please sign in to comment.