Skip to content

Commit

Permalink
Add missing awaits; MasterDuke++
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Aug 23, 2017
1 parent ccdfa46 commit 5c75f77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/Type/atomicint.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ must be used in conjunction with the atomic operations.
# Correct (will always output 80000)
my atomicint $total = 0;
start { for ^20000 { $total⚛++ } } xx 4;
await start { for ^20000 { $total⚛++ } } xx 4;
say $total;
# Either works correctly or dies, depending on platform.
my int $total = 0;
start { for ^20000 { $total⚛++ } } xx 4;
await start { for ^20000 { $total⚛++ } } xx 4;
say $total;
# Wrong due to lack of use of the atomic increment operator.
my atomicint $total = 0;
start { for ^20000 { $total++ } } xx 4;
await start { for ^20000 { $total++ } } xx 4;
say $total;
=head1 Routines
Expand Down

0 comments on commit 5c75f77

Please sign in to comment.