Re: 'use threads::shared' noisy with -w
[p5sagit/p5-mst-13.2.git] / ext / threads / shared / t / no_share.t
index 519d9cb..7e5a80f 100644 (file)
@@ -1,6 +1,4 @@
-
-
-
+use warnings;
 
 BEGIN {
 #    chdir 't' if -d 't';
@@ -17,6 +15,7 @@ BEGIN {
 sub ok {
     my ($id, $ok, $name) = @_;
 
+    $name = '' unless defined $name;
     # You have to do it this way or VMS will get confused.
     print $ok ? "ok $id - $name\n" : "not ok $id - $name\n";
 
@@ -33,7 +32,7 @@ use threads::shared;
 use threads;
 ok(1,1,"loaded");
 ok(2,$warnmsg =~ /Warning, threads::shared has already been loaded/,
-    "threads has warned us"); 
+    "threads has warned us");
 my $test = "bar";
 share($test);
 ok(3,$test eq "bar","Test disabled share not interfering");
@@ -42,6 +41,7 @@ threads->create(
                    ok(4,$test eq "bar","Test disabled share after thread");
                    $test = "baz";
                    })->join();
-ok(5,$test eq "bar","Test that value hasn't changed in another thread");
+# Value should either remain unchanged or be value set by other thread
+ok(5,$test eq "bar" || $test eq 'baz',"Test that value is an expected one");
+