This code is using the double-checked locking idiom, which does not work in
Java:
Class clazz = getScriptClassFromMap(script);
if (clazz != null) {
return clazz;
}
synchronized (this) {
clazz = getScriptClassFromMap(script);
if (clazz != null) {
return clazz;
}
See https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
I don't know the details well enough to judge whether the failure modes will be
harmful in this case. I think it's best avoided or replaced with one of the
suggestions in the link above.
-Paul
-----Original Message-----
From: spmallette [mailto:[email protected]]
Sent: Tuesday, March 07, 2017 6:25 AM
To: [email protected]
Subject: [GitHub] tinkerpop issue #567: TINKERPOP-1644 Improve script
compilation syncronisati...
Github user spmallette commented on the issue:
https://github.com/apache/tinkerpop/pull/567
I will clean up a few code formatting things on merge, but this looks good
to me. All tests pass with `docker/build.sh -t -n -i`
VOTE +1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket with
INFRA.
---
________________________________