Skip to content

Commit

Permalink
#462 still broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 7, 2021
1 parent 2b59f71 commit 4955e33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions eo-runtime/src/main/java/org/eolang/CachedPhi.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ public String toString() {
*/
public Phi get(final String name, final Supplier<Phi> supplier) {
synchronized (this.cached) {
if (!this.cached.containsKey(0) || this.running.get()) {
this.cached.put(0, supplier.get());
if (this.running.get()) {
this.cached.remove(0);
}
this.running.set(true);
if (!this.cached.containsKey(0)) {
this.cached.put(0, supplier.get());
}
final Phi ret = this.cached.get(0);
if ("Δ".equals(name)) {
this.cached.remove(0);
Expand Down
2 changes: 1 addition & 1 deletion eo-runtime/src/test/eo/org/eolang/gray/cage-tests.eo
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
seq > @
x.write 0
x.write (x.add 1)
x.eq 1
x.eq 0

0 comments on commit 4955e33

Please sign in to comment.