We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54a0a27 commit 056961aCopy full SHA for 056961a
src/QAST/Node.nqp
@@ -107,13 +107,14 @@ class QAST::Node {
107
%!annotations := nqp::null();
108
}
109
110
- my %global-uniques;
+ my $uniques_lock := NQPLock.new;
111
+ my %uniques;
112
method unique($prefix) {
- my %uniques := nqp::clone(%global-uniques);
113
+ nqp::lock($uniques_lock);
114
my $id := nqp::existskey(%uniques, $prefix) ??
115
(%uniques{$prefix} := %uniques{$prefix} + 1) !!
116
(%uniques{$prefix} := 1);
- %global-uniques := %uniques;
117
+ nqp::unlock($uniques_lock);
118
$prefix ~ '_' ~ $id
119
120
0 commit comments