ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [28/50] [abbrv] incubator-ignite git commit: IGNITE-137 Use mutex to synchronization instead of IgniteAsyncSupportAdapter.class. Fix line length.
Date Wed, 28 Jan 2015 13:40:19 GMT
IGNITE-137 Use mutex to synchronization instead of IgniteAsyncSupportAdapter.class. Fix line
length.


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

Branch: refs/heads/ignite-88
Commit: 7614cff4143099be261ed43ea15da66144aa2989
Parents: 885e070
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed Jan 28 13:06:48 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Jan 28 13:06:48 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/internal/IgniteComputeImpl.java  | 9 ++++++---
 .../org/apache/ignite/lang/IgniteAsyncSupportAdapter.java   | 5 ++++-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7614cff4/modules/core/src/main/java/org/apache/ignite/internal/IgniteComputeImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteComputeImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteComputeImpl.java
index 79f7306..16d6e9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteComputeImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteComputeImpl.java
@@ -35,7 +35,8 @@ import static org.apache.ignite.internal.processors.task.GridTaskThreadContextKe
 /**
  * {@link IgniteCompute} implementation.
  */
-public class IgniteComputeImpl extends IgniteAsyncSupportAdapter<IgniteCompute> implements
IgniteCompute, Externalizable {
+public class IgniteComputeImpl extends IgniteAsyncSupportAdapter<IgniteCompute>
+    implements IgniteCompute, Externalizable {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -80,7 +81,8 @@ public class IgniteComputeImpl extends IgniteAsyncSupportAdapter<IgniteCompute>
     }
 
     /** {@inheritDoc} */
-    @Override public void affinityRun(@Nullable String cacheName, Object affKey, Runnable
job) throws IgniteCheckedException {
+    @Override public void affinityRun(@Nullable String cacheName, Object affKey, Runnable
job)
+        throws IgniteCheckedException {
         A.notNull(affKey, "affKey");
         A.notNull(job, "job");
 
@@ -191,7 +193,8 @@ public class IgniteComputeImpl extends IgniteAsyncSupportAdapter<IgniteCompute>
     }
 
     /** {@inheritDoc} */
-    @Override public <R, T> Collection<R> broadcast(IgniteClosure<T, R>
job, @Nullable T arg) throws IgniteCheckedException {
+    @Override public <R, T> Collection<R> broadcast(IgniteClosure<T, R>
job, @Nullable T arg)
+        throws IgniteCheckedException {
         A.notNull(job, "job");
 
         guard();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7614cff4/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupportAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupportAdapter.java
b/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupportAdapter.java
index b08d646..99b1a1e 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupportAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupportAdapter.java
@@ -23,6 +23,9 @@ import org.apache.ignite.*;
  * Adapter for {@link IgniteAsyncSupport}.
  */
 public class IgniteAsyncSupportAdapter<T extends IgniteAsyncSupport> implements IgniteAsyncSupport
{
+    /** */
+    private static final Object mux = new Object();
+
     /** Future for previous asynchronous operation. */
     protected ThreadLocal<IgniteFuture<?>> curFut;
 
@@ -54,7 +57,7 @@ public class IgniteAsyncSupportAdapter<T extends IgniteAsyncSupport>
implements
         if (res == null) {
             res = createAsyncInstance();
 
-            synchronized (IgniteAsyncSupportAdapter.class) {
+            synchronized (mux) {
                 if (asyncInstance != null)
                     return asyncInstance;
 


Mime
View raw message