11use parking_lot:: RwLock ;
22use qmdb:: config:: Config ;
3- use qmdb:: def:: {
4- DEFAULT_ENTRY_SIZE , IN_BLOCK_IDX_BITS , OP_CREATE ,
5- } ;
3+ use qmdb:: def:: { DEFAULT_ENTRY_SIZE , IN_BLOCK_IDX_BITS , OP_CREATE } ;
64use qmdb:: entryfile:: EntryBz ;
75use qmdb:: tasks:: TasksManager ;
86use qmdb:: test_helper:: SimpleTask ;
@@ -58,10 +56,7 @@ fn main() {
5856 //task id's high 40 bits is block height and low 24 bits is task index
5957 let last_task_id = ( height << IN_BLOCK_IDX_BITS ) | ( task_count - 1 ) ;
6058 //add the tasks into QMDB
61- ads. start_block (
62- height,
63- Arc :: new ( TasksManager :: new ( task_list, last_task_id) ) ,
64- ) ;
59+ ads. start_block ( height, Arc :: new ( TasksManager :: new ( task_list, last_task_id) ) ) ;
6560 //multiple shared_ads can be shared by different threads
6661 let shared_ads = ads. get_shared ( ) ;
6762 //you can associate some extra data in json format to each block
@@ -86,6 +81,6 @@ fn main() {
8681 // now we use another shared_ads to read entry out
8782 let shared_ads = ads. get_shared ( ) ;
8883 let ( n, ok) = shared_ads. read_entry ( -1 , & kh[ ..] , & [ ] , & mut buf) ;
89- let e = EntryBz { bz : & buf[ ..n] } ;
84+ let e = EntryBz { bz : & buf[ ..n] } ;
9085 println ! ( "entry={:?} value={:?} ok={}" , & buf[ ..n] , e. value( ) , ok) ;
9186}
0 commit comments