This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
threads 1.64 (repost)
[perl5.git] / ext / threads / t / end.t
index 32b3f1a..9960633 100644 (file)
@@ -16,15 +16,26 @@ BEGIN {
 use ExtUtils::testlib;
 
 use threads;
-use threads::shared;
 
 BEGIN {
+    eval {
+        require threads::shared;
+        threads::shared->import();
+    };
+    if ($@ || ! $threads::shared::threads_shared) {
+        print("1..0 # Skip: threads::shared not available\n");
+        exit(0);
+    }
+
     $| = 1;
     print("1..6\n");   ### Number of tests that will be run ###
 };
 
-my $TEST = 1;
-share($TEST);
+my $TEST;
+BEGIN {
+    share($TEST);
+    $TEST = 1;
+}
 
 ok(1, 'Loaded');