In the last Rakudo development snapshot, your code really works without any exceptions on my system ...
However, it still asks for both ( I am X: Enter x: I am Y: Enter y:) values at once .
So that the second promptwaits for the completion of the first, you can use Lock:
#--- Main code ---
my $x = start { synchronized-prompt "I am X: Enter x: "; }
my $y = start { synchronized-prompt "I am Y: Enter y: "; }
await $x, $y;
say $x.result;
say $y.result;
#--- Helper routines ---
BEGIN my $prompt-lock = Lock.new;
sub synchronized-prompt ($message) {
$prompt-lock.protect: { prompt $message; }
}
, , . Lock.new synchronized-prompt, . , , BEGIN phaser, .