We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7a5449 commit 5628a23Copy full SHA for 5628a23
samples/bench/src/lib.rs
@@ -619,15 +619,16 @@ impl Simple {
619
);
620
621
// Before we go away, make sure that there aren't any leaked workers.
622
- /*
623
let mut locked = main.action().locked.lock().unwrap();
624
while let Some(other) = locked.works.pop_front() {
625
- // Portable atomic's Arc seems to be a problem here.
626
- let other = unsafe { Pin::into_inner_unchecked(other) };
+ let other = Pin::into_inner(other);
627
assert_eq!(Arc::strong_count(&other), 1);
628
- // printkln!("Child: {} refs", Arc::strong_count(&other));
629
}
630
- */
+ drop(locked);
+
+ // And nothing has leaked main, either.
+ let main = Pin::into_inner(main);
631
+ assert_eq!(Arc::strong_count(&main), 1);
632
633
634
0 commit comments