File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use crate :: println;
22use core:: sync:: atomic:: Ordering ;
3- use crate :: vfs:: { STATE_VERIFIED , STATE_CORRUPTED , CachedVfsBlock } ;
3+ use crate :: vfs:: { STATE_VERIFIED , STATE_CORRUPTED } ;
44use crate :: task:: CryptoVerificationJob ;
55
66#[ derive( Debug , Clone ) ]
Original file line number Diff line number Diff line change @@ -31,7 +31,16 @@ pub struct CryptoVerificationJob {
3131}
3232
3333// Global thread-safe async queue for block validation
34- pub static VERIFICATION_QUEUE : OnceCell < ArrayQueue < CryptoVerificationJob > > = OnceCell :: new ( ) ;
34+ #[ derive( Clone , Copy ) ]
35+ pub struct CryptoVerificationJob {
36+ pub block_ptr : * mut CachedVfsBlock ,
37+ pub expected_hash : [ u8 ; 32 ] ,
38+ }
39+
40+ unsafe impl Send for CryptoVerificationJob { }
41+ unsafe impl Sync for CryptoVerificationJob { }
42+
43+ pub static VERIFICATION_QUEUE : OnceCell < ArrayQueue < CryptoVerificationJob > > = OnceCell :: uninit ( ) ;
3544
3645pub fn init_queue ( ) {
3746 VERIFICATION_QUEUE . init_once ( || ArrayQueue :: new ( 32 ) ) ;
Original file line number Diff line number Diff line change @@ -96,7 +96,6 @@ pub const STATE_PENDING: u8 = 0;
9696pub const STATE_VERIFIED : u8 = 1 ;
9797pub const STATE_CORRUPTED : u8 = 2 ;
9898
99- #[ derive( Clone ) ]
10099pub struct CachedVfsBlock {
101100 pub block_id : u64 ,
102101 pub data : [ u8 ; 4096 ] ,
You can’t perform that action at this time.
0 commit comments