Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add diag message for thread running *after* join
  • Loading branch information
lizmat committed Apr 7, 2014
1 parent 3ff5fbb commit 792f7a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S17-concurrency/lock.t
Expand Up @@ -52,13 +52,16 @@ plan 7;
{
my $l = Lock.new;
my $c = $l.condition;
my $now1;
my $now2 = now;
my @log;

my $t1 = Thread.start({
$l.protect({
@log.push('ale');
$c.wait();
@log.push('stout');
$now1 = now;
});
});

Expand All @@ -72,8 +75,9 @@ plan 7;
});

$t1.join();
$now2 = now;
$t2.join();

diag "log = {@log}" if !
diag "log = {@log}{ $now1>$now2 ?? ', thread was running *after* join' !! ''}" if !
is @log.join(','), 'ale,porter,stout', 'Condition variable worked';
}

0 comments on commit 792f7a8

Please sign in to comment.