Merge
authorkevinw
Wed, 25 Feb 2009 14:32:01 +0000
changeset 2167 bff30f8ab689
parent 2166 e01c813f9552 (current diff)
parent 2165 98373487fcf4 (diff)
child 2168 de3c5a0416de
Merge
--- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java	Tue Feb 24 19:03:58 2009 +0000
+++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java	Wed Feb 25 14:32:01 2009 +0000
@@ -1222,8 +1222,10 @@
         // The correctness of this depends on head being initialized
         // before tail and on head.next being accurate if the current
         // thread is first in queue.
-        Node h, s;
-        return (h = head) != tail &&
+        Node t = tail; // Read fields in reverse initialization order
+        Node h = head;
+        Node s;
+        return h != t &&
             ((s = h.next) == null || s.thread != Thread.currentThread());
     }
 
--- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java	Tue Feb 24 19:03:58 2009 +0000
+++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java	Wed Feb 25 14:32:01 2009 +0000
@@ -1445,8 +1445,10 @@
         // The correctness of this depends on head being initialized
         // before tail and on head.next being accurate if the current
         // thread is first in queue.
-        Node h, s;
-        return (h = head) != tail &&
+        Node t = tail; // Read fields in reverse initialization order
+        Node h = head;
+        Node s;
+        return h != t &&
             ((s = h.next) == null || s.thread != Thread.currentThread());
     }