GEODE-6011: Prevent synchronization using strings and boolean#2807
GEODE-6011: Prevent synchronization using strings and boolean#2807jake-at-work merged 4 commits intoapache:developfrom
Conversation
|
@nabarunnag any thoughts on using an autoclosable wrapper and using with resource to guard these locks? |
|
@pivotal-jbarrett Thank you for your suggestion and I felt that it was a good idea to get the lock under a TWR. |
|
@nabarunnag Good point on the object creation overhead. Been in C++ land so long I didn't even think about that cost of RAII in Java. |
cb329c7 to
56e20c1
Compare
* Locking is now achieved using reentrant locks as they are more fair than synchronization.
56e20c1 to
6551d04
Compare
Previous locking fix move then locking scope to per-instance from global (per-classloader). This would allow the this function to attempt simultaneous registration of functions and potentially fail for duplicate functions.
| private static final long serialVersionUID = 1856043174458190605L; | ||
|
|
||
| public static final String ID = "bootstrapping-function"; | ||
| private static final ReentrantLock registerFuntionLock = new ReentrantLock(); |
There was a problem hiding this comment.
typo: should be registerFunctionLock
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop)?Is your initial contribution a single, squashed commit?
Does
gradlew buildrun cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.