fast exit dynamic test
This commit is contained in:
committed by
Greg Fitzgerald
parent
47a22c66b4
commit
72282dc493
@ -318,6 +318,10 @@ impl FullNode {
|
||||
FullNode { exit, thread_hdls }
|
||||
}
|
||||
|
||||
//used for notifying many nodes in parallel to exit
|
||||
pub fn notify_exit(self) {
|
||||
self.exit.store(true, Ordering::Relaxed);
|
||||
}
|
||||
pub fn close(self) -> Result<()> {
|
||||
self.exit.store(true, Ordering::Relaxed);
|
||||
self.join()
|
||||
@ -355,6 +359,7 @@ mod tests {
|
||||
let exit = Arc::new(AtomicBool::new(false));
|
||||
let entry = tn.data.clone();
|
||||
let v = FullNode::new_validator(kp, bank, 0, None, tn, &entry, exit);
|
||||
v.notify_exit();
|
||||
v.close().unwrap();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user