# New Ticket Created by "Brian S. Julin" # Please include the string: [perl #127659] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=127659 >
In role SimpleOpTappable, the method !cleanup uses a Perl 6 int in a lock-like fashion: method !cleanup(int $cleaned-up is rw, $source-tap) { if $source-tap && !$cleaned-up { $cleaned-up = 1; $source-tap.close; } } This seems to be primarily tasked with ensuring that the &on-closed closure of the composed supply is not run more than once. A lot of the places are protected by serial supply locks, however that is not true in the case of the &on-closed of the composite Supply, nor in the .on-closed simpleop, so an absolute guarantee of this cannot be made between different closers of that Tap object, or between a single closer and an emit/done/quit. Maybe using Tap.new({ once self!cleanup($source-tap) }) instead would prevent the need for $cleaned-up?