Re: where threads cond.t hangs
Dave Mitchell [Thu, 9 May 2002 17:18:42 +0000 (18:18 +0100)]
Message-ID: <20020509171842.C9836@fdgroup.com>

p4raw-id: //depot/perl@16529

ext/threads/shared/t/cond.t

index b757fb5..71f6012 100644 (file)
@@ -21,13 +21,14 @@ my $lock : shared;
 sub foo {
     lock($lock);
     print "ok 1\n";
-    sleep 2;
-    print "ok 2\n";
+    my $tr2 = threads->create(\&bar);
     cond_wait($lock);
+    $tr2->join();
     print "ok 5\n";
 }
 
 sub bar {
+    print "ok 2\n";
     lock($lock);
     print "ok 3\n";
     cond_signal($lock);
@@ -35,7 +36,5 @@ sub bar {
 }
 
 my $tr  = threads->create(\&foo);
-my $tr2 = threads->create(\&bar);
 $tr->join();
-$tr2->join();