Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible race in Supply simple operations when closing Tap #5162

Open
p6rt opened this issue Mar 5, 2016 · 1 comment
Open

Possible race in Supply simple operations when closing Tap #5162

p6rt opened this issue Mar 5, 2016 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 5, 2016

Migrated from rt.perl.org#127659 (status was 'new')

Searchable as RT127659$

@p6rt
Copy link
Author

p6rt commented Mar 5, 2016

From @skids

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?

@p6rt p6rt added the conc label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant