This is an automated email from the ASF dual-hosted git repository.

siddteotia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 55848a3  ARROW-4104: [Java] fix a race condition in AllocationManager 
(#3246)
55848a3 is described below

commit 55848a36edb5ea5e0765068ef5f09d07d09d4898
Author: Pindikura Ravindra <[email protected]>
AuthorDate: Tue Jan 8 16:13:18 2019 +0530

    ARROW-4104: [Java] fix a race condition in AllocationManager (#3246)
---
 .../src/main/java/org/apache/arrow/memory/AllocationManager.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/java/memory/src/main/java/org/apache/arrow/memory/AllocationManager.java 
b/java/memory/src/main/java/org/apache/arrow/memory/AllocationManager.java
index 687674f..c10d246 100644
--- a/java/memory/src/main/java/org/apache/arrow/memory/AllocationManager.java
+++ b/java/memory/src/main/java/org/apache/arrow/memory/AllocationManager.java
@@ -230,7 +230,7 @@ public class AllocationManager {
       // since two balance transfers out from the allocator manager could 
cause incorrect
       // accounting, we need to ensure
       // that this won't happen by synchronizing on the allocator manager 
instance.
-      synchronized (this) {
+      synchronized (AllocationManager.this) {
         if (owningLedger != this) {
           return true;
         }
@@ -310,7 +310,7 @@ public class AllocationManager {
       allocator.assertOpen();
 
       final int outcome;
-      synchronized (this) {
+      synchronized (AllocationManager.this) {
         outcome = bufRefCnt.addAndGet(-decrement);
         if (outcome == 0) {
           lDestructionTime = System.nanoTime();
@@ -411,7 +411,7 @@ public class AllocationManager {
      * @return Amount of accounted(owned) memory associated with this ledger.
      */
     public int getAccountedSize() {
-      synchronized (this) {
+      synchronized (AllocationManager.this) {
         if (owningLedger == this) {
           return size;
         } else {

Reply via email to