5 if ($ENV{'PERL_CORE'}){
7 unshift @INC, '../lib';
10 if (! $Config{'useithreads'}) {
11 print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
16 use ExtUtils::testlib;
19 my ($id, $ok, $name) = @_;
21 # You have to do it this way or VMS will get confused.
23 print("ok $id - $name\n");
25 print("not ok $id - $name\n");
26 printf("# Failed test at line %d\n", (caller)[2]);
36 require threads::shared;
37 import threads::shared;
39 if ($@ || ! $threads::shared::threads_shared) {
40 print("1..0 # Skip: threads::shared not available\n");
45 print("1..12\n"); ### Number of tests that will be run ###
50 ### Start of Testing ###
57 $localtime{$_} = localtime($_);
65 my $thread = threads->create(sub {
67 my $localtime = $localtime{$arg};
70 my $lt = localtime($arg);
71 if ($localtime ne $lt) {
76 while ($mutex != ($_ + 2)) {
79 ok($mutex, ! $error, 'localtime safe');
81 cond_broadcast($mutex);
83 push @threads, $thread;