3 # Tests if $$ and getppid return consistent values across threads
14 if (!$Config{useithreads}) {
15 print "1..0 # Skip: no ithreads\n";
18 if (!$Config{d_getppid}) {
19 print "1..0 # Skip: no getppid\n";
27 my ($pid, $ppid) = ($$, getppid());
28 my $pid2 : shared = 0;
29 my $ppid2 : shared = 0;
31 new threads( sub { ($pid2, $ppid2) = ($$, getppid()); } ) -> join();
34 print "not " if $pid != $pid2; print "ok 1 - pids\n";
35 print "not " if $ppid != $ppid2; print "ok 2 - ppids\n";