Skip to content

Commit

Permalink
Add a multithread test
Browse files Browse the repository at this point in the history
  • Loading branch information
yjugl authored and padenot committed Mar 13, 2024
1 parent 46c14d5 commit 9d5da95
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 9d5da95

Please sign in to comment.