pub(crate) struct VerifyAccountsHashInBackground {
pub(crate) verified: Arc<AtomicBool>,
complete: Arc<WaitableCondvar>,
thread: Mutex<Option<JoinHandle<bool>>>,
background_completed: Arc<AtomicBool>,
}
Fields§
§verified: Arc<AtomicBool>
true when verification has completed or never had to run in background
complete: Arc<WaitableCondvar>
enable waiting for verification to become complete
thread: Mutex<Option<JoinHandle<bool>>>
thread doing verification
background_completed: Arc<AtomicBool>
set when background thread has completed
Implementations§
source§impl VerifyAccountsHashInBackground
impl VerifyAccountsHashInBackground
sourcepub(crate) fn start(&self, start: impl FnOnce() -> JoinHandle<bool>)
pub(crate) fn start(&self, start: impl FnOnce() -> JoinHandle<bool>)
start the bg thread to do the verification
sourcepub(crate) fn background_finished(&self)
pub(crate) fn background_finished(&self)
notify that the bg process has completed
sourcepub(crate) fn verification_complete(&self)
pub(crate) fn verification_complete(&self)
notify that verification was completed successfully This can occur because it completed in the background or if the verification was run in the foreground.
sourcepub fn wait_for_complete(&self)
pub fn wait_for_complete(&self)
block until bg process is complete
sourcepub(crate) fn check_complete(&self) -> bool
pub(crate) fn check_complete(&self) -> bool
return true if bg hash verification is complete return false if bg hash verification has not completed yet if hash verification failed, a panic will occur
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for VerifyAccountsHashInBackground
impl Send for VerifyAccountsHashInBackground
impl Sync for VerifyAccountsHashInBackground
impl Unpin for VerifyAccountsHashInBackground
impl UnwindSafe for VerifyAccountsHashInBackground
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more