Skip to content

Commit

Permalink
Add a multithread test
Browse files Browse the repository at this point in the history
  • Loading branch information
yjugl committed Mar 13, 2024
1 parent 4d11137 commit 36cd677
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,15 @@ mod tests {
// automatically deallocated, but not demoted until the thread exits.
}
}

#[test]
fn it_works_in_different_threads() {
let handles: Vec<_> = (0..32).map(|_| std::thread::spawn(it_works)).collect();
for handle in handles {
handle.join().unwrap()
}
}

cfg_if! {
if #[cfg(target_os = "linux")] {
use nix::unistd::*;
Expand Down

0 comments on commit 36cd677

Please sign in to comment.