3 # Tests if $$ and getppid return consistent values across threads
15 skip_all_without_config(qw(useithreads d_getppid));
16 skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
17 eval 'use threads; use threads::shared';
20 fail("unable to load thread modules");
23 pass("thread modules loaded");
27 my ($pid, $ppid) = ($$, getppid());
28 my $pid2 : shared = 0;
29 my $ppid2 : shared = 0;
31 new threads( sub { ($pid2, $ppid2) = ($$, getppid()); } ) -> join();
33 is($pid, $pid2, 'pids');
34 is($ppid, $ppid2, 'ppids');