Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't synchronize on invalidator getter methods

  • Loading branch information...
commit 79dad3ea404d7a8c259f5a50f834acf82cb2db3e 1 parent eb6de50
@charliesome charliesome authored
View
11 src/org/jruby/ast/Colon3Node.java
@@ -151,14 +151,9 @@ public IRubyObject reCache(ThreadContext context, String name) {
}
protected Invalidator invalidator(ThreadContext context) {
- if (invalidator != null) {
- return invalidator;
- }
- synchronized (this) {
- if (invalidator == null) {
- invalidator = context.runtime.getConstantInvalidator(name);
- }
- return invalidator;
+ if (invalidator == null) {
+ invalidator = context.runtime.getConstantInvalidator(name);
}
+ return invalidator;
}
}
View
13 src/org/jruby/ast/ConstNode.java
@@ -124,15 +124,10 @@ public IRubyObject reCache(ThreadContext context, String name) {
return value;
}
- protected Invalidator invalidator(ThreadContext context) {
- if (invalidator != null) {
- return invalidator;
- }
- synchronized (this) {
- if (invalidator == null) {
- invalidator = context.runtime.getConstantInvalidator(name);
- }
- return invalidator;
+ private Invalidator invalidator(ThreadContext context) {
+ if (invalidator == null) {
+ invalidator = context.runtime.getConstantInvalidator(name);
}
+ return invalidator;
}
}
View
11 src/org/jruby/ir/instructions/InheritanceSearchConstInstr.java
@@ -123,14 +123,9 @@ public boolean isNoPrivateConsts() {
}
private Invalidator invalidator(Ruby runtime) {
- if (invalidator != null) {
- return invalidator;
- }
- synchronized (this) {
- if (invalidator == null) {
- invalidator = runtime.getConstantInvalidator(constName);
- }
- return invalidator;
+ if (invalidator == null) {
+ invalidator = runtime.getConstantInvalidator(constName);
}
+ return invalidator;
}
}
View
11 src/org/jruby/ir/instructions/LexicalSearchConstInstr.java
@@ -105,14 +105,9 @@ public void visit(IRVisitor visitor) {
}
private Invalidator invalidator(Ruby runtime) {
- if (invalidator != null) {
- return invalidator;
- }
- synchronized (this) {
- if (invalidator == null) {
- invalidator = runtime.getConstantInvalidator(constName);
- }
- return invalidator;
+ if (invalidator == null) {
+ invalidator = runtime.getConstantInvalidator(constName);
}
+ return invalidator;
}
}
View
11 src/org/jruby/ir/instructions/SearchConstInstr.java
@@ -125,14 +125,9 @@ public boolean isNoPrivateConsts() {
}
private Invalidator invalidator(Ruby runtime) {
- if (invalidator != null) {
- return invalidator;
- }
- synchronized (this) {
- if (invalidator == null) {
- invalidator = runtime.getConstantInvalidator(constName);
- }
- return invalidator;
+ if (invalidator == null) {
+ invalidator = runtime.getConstantInvalidator(constName);
}
+ return invalidator;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.