@@ -2,9 +2,10 @@ use std::convert::TryInto;
2
2
use std:: marker:: PhantomData ;
3
3
use std:: mem:: { self , size_of} ;
4
4
use std:: path:: Path ;
5
+ use std:: rc:: Rc ;
5
6
use std:: sync:: {
6
7
atomic:: { AtomicU64 , Ordering :: SeqCst } ,
7
- Arc , MutexGuard ,
8
+ MutexGuard ,
8
9
} ;
9
10
use std:: thread;
10
11
use std:: time:: Duration ;
@@ -208,7 +209,7 @@ fn create_layer_labels(
208
209
exp_labels : Option < & mut MmapMut > ,
209
210
num_nodes : u64 ,
210
211
cur_layer : u32 ,
211
- core_group : Arc < Option < MutexGuard < ' _ , Vec < CoreIndex > > > > ,
212
+ core_group : Rc < Option < MutexGuard < ' _ , Vec < CoreIndex > > > > ,
212
213
) {
213
214
info ! ( "Creating labels for layer {}" , cur_layer) ;
214
215
// num_producers is the number of producer threads
@@ -458,7 +459,7 @@ pub fn create_labels_for_encoding<
458
459
459
460
let default_cache_size = DEGREE * 4 * cache_window_nodes;
460
461
461
- let core_group = Arc :: new ( checkout_core_group ( ) ) ;
462
+ let core_group = Rc :: new ( checkout_core_group ( ) ) ;
462
463
463
464
// When `_cleanup_handle` is dropped, the previous binding of thread will be restored.
464
465
let _cleanup_handle = ( * core_group) . as_ref ( ) . map ( |group| {
@@ -556,7 +557,7 @@ pub fn create_labels_for_decoding<Tree: 'static + MerkleTreeTrait, T: AsRef<[u8]
556
557
557
558
let default_cache_size = DEGREE * 4 * cache_window_nodes;
558
559
559
- let core_group = Arc :: new ( checkout_core_group ( ) ) ;
560
+ let core_group = Rc :: new ( checkout_core_group ( ) ) ;
560
561
561
562
// When `_cleanup_handle` is dropped, the previous binding of thread will be restored.
562
563
let _cleanup_handle = ( * core_group) . as_ref ( ) . map ( |group| {
0 commit comments