This runs reliably when you let the lock-protected block return something unrelated to the hash:
#!/usr/bin/env perl6
use v6.c;
my $lock = Lock.new;
my $set = SetHash.new;
await (^12).map: {
start {
for (^1000) {
$lock.protect: { $set<1> = True }
$lock.protect: { $set<1> = False }
}
}
}
My assumption is that it has something to do with sinking the Bool we're
assigning outside the lock-protected block, but printing the .VAR of
what it returns is really just a Bool object ...
