diff options
-rw-r--r-- | lib/Thread.t | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Thread.t b/lib/Thread.t index 2a0e2af5af..18694c5b98 100644 --- a/lib/Thread.t +++ b/lib/Thread.t @@ -72,9 +72,15 @@ COND_: return Thread->self->tid; } - my $thr = Thread->new(\&thr_wait); - isa_ok($thr, 'Thread'); - ok(! $thr->done(), 'Thread running'); + my $thr; + { + lock($lock); + $thr = Thread->new(\&thr_wait); + isa_ok($thr, 'Thread'); + ok(! $thr->done(), 'Thread running'); + } + yield(); + sleep(1); { lock($lock); |