diff --git a/storage-proofs/porep/src/stacked/vanilla/create_label/multi.rs b/storage-proofs/porep/src/stacked/vanilla/create_label/multi.rs index 4606601aad..b11e07898b 100644 --- a/storage-proofs/porep/src/stacked/vanilla/create_label/multi.rs +++ b/storage-proofs/porep/src/stacked/vanilla/create_label/multi.rs @@ -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,