Skip to content

Commit

Permalink
Accept Mu as cas target and values
Browse files Browse the repository at this point in the history
  • Loading branch information
dumarchie committed Nov 28, 2020
1 parent 2a44729 commit 998cae5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core.c/atomicops.pm6
Expand Up @@ -18,11 +18,11 @@ multi sub atomic-assign($target is rw, \value) {
}

#-- atomic compare and swap
proto sub cas($, $, $?, *%) {*}
multi sub cas($target is rw, \expected, \value) {
proto sub cas(Mu $, Mu $, Mu $?, *%) {*}
multi sub cas(Mu $target is rw, Mu \expected, Mu \value) {
nqp::cas($target, expected, value)
}
multi sub cas($target is rw, &code) {
multi sub cas(Mu $target is rw, &code) {
my $current := nqp::atomicload($target);
nqp::until(
nqp::stmts(
Expand Down

0 comments on commit 998cae5

Please sign in to comment.