cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r882682 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: gms/FailureDetector.java gms/Gossiper.java net/MessagingService.java
Date Fri, 20 Nov 2009 19:06:48 GMT
Author: jbellis
Date: Fri Nov 20 19:06:22 2009
New Revision: 882682

URL: http://svn.apache.org/viewvc?rev=882682&view=rev
Log:
make members volatile where necessary to make double-checked locking safe.  patch by gdusbabek;
reviewed by jbellis for CASSANDRA-248

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java?rev=882682&r1=882681&r2=882682&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java Fri Nov
20 19:06:22 2009
@@ -49,7 +49,7 @@
     private static final int phiConvictThreshold_ = 8;
     /* The Failure Detector has to have been up for at least 1 min. */
     private static final long uptimeThreshold_ = 60000;
-    private static IFailureDetector failureDetector_;
+    private static volatile IFailureDetector failureDetector_;
     /* Used to lock the factory for creation of FailureDetector instance */
     private static Lock createLock_ = new ReentrantLock();
     /* The time when the module was instantiated. */

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=882682&r1=882681&r2=882682&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Fri Nov 20 19:06:22
2009
@@ -96,7 +96,7 @@
     final static String GOSSIP_DIGEST_ACK2_VERB = "GA2V";
     public final static int intervalInMillis_ = 1000;
     private static Logger logger_ = Logger.getLogger(Gossiper.class);
-    static Gossiper gossiper_;
+    private static volatile Gossiper gossiper_;
 
     public synchronized static Gossiper instance()
     {

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=882682&r1=882681&r2=882682&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Fri
Nov 20 19:06:22 2009
@@ -89,7 +89,7 @@
     
     private static Logger logger_ = Logger.getLogger(MessagingService.class);
     
-    private static MessagingService messagingService_ = new MessagingService();
+    private static volatile MessagingService messagingService_ = new MessagingService();
 
     private static final int MESSAGE_DESERIALIZE_THREADS = 4;
 



Mime
View raw message