ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [34/44] incubator-ignite git commit: IGNITE-59 Support lock, lockAll. Fix test's problems.
Date Tue, 20 Jan 2015 12:54:03 GMT
IGNITE-59 Support lock, lockAll. Fix test's problems.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2c76212f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2c76212f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2c76212f

Branch: refs/heads/ignite-94
Commit: 2c76212f255c8e83028a3b285c71374bd738f5bc
Parents: fd03d80
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Mon Jan 19 17:14:59 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Mon Jan 19 17:14:59 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/IgniteCacheProxy.java   | 6 +++---
 .../processors/cache/GridCacheBasicApiAbstractTest.java      | 8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c76212f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 64e86dd..0506c5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -318,12 +318,12 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter
implements
                     throw new InterruptedException();
 
                 try {
+                    if (time <= 0)
+                        return delegate.lockAll(keys, -1);
+
                     IgniteFuture<Boolean> fut = null;
 
                     try {
-                        if (time <= 0)
-                            return delegate.lockAll(keys, -1);
-
                         fut = delegate.lockAllAsync(keys, time <= 0 ? -1 : unit.toMillis(time));
 
                         return fut.get();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c76212f/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
index 3352356..66e9cb4 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheBasicApiAbstractTest.java
@@ -193,6 +193,8 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
 
         t.start();
 
+        Thread.sleep(100);
+
         t.interrupt();
 
         cache.lock(1).unlock();
@@ -225,12 +227,14 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
 
         t.start();
 
-        t.interrupt();
+        Thread.sleep(100);
 
-        cache.lock(2).unlock();
+        t.interrupt();
 
         t.join();
 
+        cache.lock(2).unlock();
+
         assertFalse(cache.lock(1).isLocked());
         assertFalse(cache.lock(2).isLocked());
 


Mime
View raw message