# HG changeset patch # User dl # Date 1543447514 28800 # Node ID 345266000abacec116b54c0a73ea0843de7fc700 # Parent 0775f246731b73ec300b2583985daab7255742dd 8211283: Miscellaneous changes imported from jsr166 CVS 2018-11 Reviewed-by: martin, chegar diff -r 0775f246731b -r 345266000aba src/java.base/share/classes/java/util/ArrayDeque.java --- a/src/java.base/share/classes/java/util/ArrayDeque.java Wed Nov 28 15:25:14 2018 -0800 +++ b/src/java.base/share/classes/java/util/ArrayDeque.java Wed Nov 28 15:25:14 2018 -0800 @@ -37,7 +37,6 @@ import java.io.Serializable; import java.util.function.Consumer; import java.util.function.Predicate; - import jdk.internal.access.SharedSecrets; /** diff -r 0775f246731b -r 345266000aba src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java Wed Nov 28 15:25:14 2018 -0800 +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java Wed Nov 28 15:25:14 2018 -0800 @@ -2542,6 +2542,8 @@ setTabAt(tab, i, fwd); advance = true; } + else if (f instanceof ReservationNode) + throw new IllegalStateException("Recursive update"); } } } diff -r 0775f246731b -r 345266000aba src/java.base/share/classes/java/util/concurrent/Exchanger.java --- a/src/java.base/share/classes/java/util/concurrent/Exchanger.java Wed Nov 28 15:25:14 2018 -0800 +++ b/src/java.base/share/classes/java/util/concurrent/Exchanger.java Wed Nov 28 15:25:14 2018 -0800 @@ -564,8 +564,8 @@ Object item = (x == null) ? NULL_ITEM : x; // translate null args if (((a = arena) != null || (v = slotExchange(item, false, 0L)) == null) && - ((Thread.interrupted() || // disambiguates null return - (v = arenaExchange(item, false, 0L)) == null))) + (Thread.interrupted() || // disambiguates null return + (v = arenaExchange(item, false, 0L)) == null)) throw new InterruptedException(); return (v == NULL_ITEM) ? null : (V)v; } @@ -620,8 +620,8 @@ long ns = unit.toNanos(timeout); if ((arena != null || (v = slotExchange(item, true, ns)) == null) && - ((Thread.interrupted() || - (v = arenaExchange(item, true, ns)) == null))) + (Thread.interrupted() || + (v = arenaExchange(item, true, ns)) == null)) throw new InterruptedException(); if (v == TIMED_OUT) throw new TimeoutException(); diff -r 0775f246731b -r 345266000aba src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java --- a/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java Wed Nov 28 15:25:14 2018 -0800 +++ b/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java Wed Nov 28 15:25:14 2018 -0800 @@ -1230,14 +1230,13 @@ /** * Immediately performs the base action of this task and returns * true if, upon return from this method, this task is guaranteed - * to have completed normally. This method may return false - * otherwise, to indicate that this task is not necessarily - * complete (or is not known to be complete), for example in - * asynchronous actions that require explicit invocations of - * completion methods. This method may also throw an (unchecked) - * exception to indicate abnormal exit. This method is designed to - * support extensions, and should not in general be called - * otherwise. + * to have completed. This method may return false otherwise, to + * indicate that this task is not necessarily complete (or is not + * known to be complete), for example in asynchronous actions that + * require explicit invocations of completion methods. This method + * may also throw an (unchecked) exception to indicate abnormal + * exit. This method is designed to support extensions, and should + * not in general be called otherwise. * * @return {@code true} if this task is known to have completed normally */ diff -r 0775f246731b -r 345266000aba src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java --- a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java Wed Nov 28 15:25:14 2018 -0800 +++ b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java Wed Nov 28 15:25:14 2018 -0800 @@ -199,10 +199,11 @@ * Disables the current thread for thread scheduling purposes, for up to * the specified waiting time, unless the permit is available. * - *

If the permit is available then it is consumed and the call - * returns immediately; otherwise the current thread becomes disabled - * for thread scheduling purposes and lies dormant until one of four - * things happens: + *

If the specified waiting time is zero or negative, the + * method does nothing. Otherwise, if the permit is available then + * it is consumed and the call returns immediately; otherwise the + * current thread becomes disabled for thread scheduling purposes + * and lies dormant until one of four things happens: * *