Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

MAIN needs sink #4527

Closed p6rt closed 9 years ago

p6rt commented 9 years ago

Migrated from rt.perl.org#126029 (status was 'resolved')

Searchable as RT126029$

p6rt commented 9 years ago

From @TimToady

22​:10 \< TimToady> m​: sub MAIN { my @​p = (start { say "A$_"; sleep rand; say "B$_" } for 1..5); await @​p; } 22​:10 \<+camelia> rakudo-moar c54773​: OUTPUT«A1␤A2␤A3␤A4␤A5␤» 22​:10 \< TimToady> m​: sub MAIN { my @​p = (start { say "A$_"; sleep rand; say "B$_" } for 1..5); sink await @​p; } 22​:10 \<+camelia> rakudo-moar c54773​: OUTPUT«A1␤A2␤A3␤A4␤A5␤B4␤B3␤B5␤B2␤B1␤» 22​:11 \< TimToady> needing to sink that await seems like a problem, since main should probably assume --> Sink 22​:12 \< TimToady> (this prevented RC's Dining Philosophers from running correctly)

p6rt commented 9 years ago

From @moritz

Fixed here​:

commit f7c2a7220628e4eb14a7a676a6a9af6b5ce79a7a Author​: Moritz Lenz \moritz@&#8203;faui2k3\.org Date​: 2015-09-19 16​:45​:43 +0000

  RT #​126029​: sink MAIN (and USAGE)

src/core/Main.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)

p6rt commented 9 years ago

From @jnthn

On Wed Sep 09 22​:27​:25 2015, larry wrote​:

22​:10 \< TimToady> m​: sub MAIN { my @​p = (start { say "A$_"; sleep rand; say "B$_" } for 1..5); await @​p; } 22​:10 \<+camelia> rakudo-moar c54773​: OUTPUT«A1␤A2␤A3␤A4␤A5␤» 22​:10 \< TimToady> m​: sub MAIN { my @​p = (start { say "A$_"; sleep rand; say "B$_" } for 1..5); sink await @​p; } 22​:10 \<+camelia> rakudo-moar c54773​: OUTPUT«A1␤A2␤A3␤A4␤A5␤B4␤B3␤B5␤B2␤B1␤» 22​:11 \< TimToady> needing to sink that await seems like a problem, since main should probably assume --> Sink 22​:12 \< TimToady> (this prevented RC's Dining Philosophers from running correctly)

Fixed by moritz++, and I added a test in S06-other/main.t.

p6rt commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p6rt commented 9 years ago

@jnthn - Status changed from 'open' to 'resolved'