RFR: jsr166 jdk9 integration wave 14

Martin Buchholz martinrb at google.com
Tue Jan 31 22:41:56 UTC 2017


On Tue, Jan 31, 2017 at 12:32 PM, Paul Sandoz <paul.sandoz at oracle.com>
wrote:

>
>>
>  131     static void spinAwait(Supplier<Boolean> waitingForGodot) {
>  132         for (int spins = 0;;) {
>  133             if (waitingForGodot.get())
>  134                 return;
>
>
> :-) "Let's wait till we know exactly how we stand.”.
>

You didn't ask for anything, but let's reclaim some vertical space without
loss of readability:

 Index: src/test/jtreg/util/concurrent/ThreadPoolExecutor/ConfigChanges.java
===================================================================
RCS file:
/export/home/jsr166/jsr166/jsr166/src/test/jtreg/util/concurrent/ThreadPoolExecutor/ConfigChanges.java,v
retrieving revision 1.11
diff -u -U 1 -r1.11 ConfigChanges.java
--- src/test/jtreg/util/concurrent/ThreadPoolExecutor/ConfigChanges.java 22
Dec 2016 00:22:22 -0000 1.11
+++ src/test/jtreg/util/concurrent/ThreadPoolExecutor/ConfigChanges.java 31
Jan 2017 22:39:48 -0000
@@ -131,5 +131,3 @@
     static void spinAwait(Supplier<Boolean> waitingForGodot) {
-        for (int spins = 0;;) {
-            if (waitingForGodot.get())
-                return;
+        for (int spins = 0; !waitingForGodot.get(); ) {
             if ((spins = (spins + 1) & 3) > 0) {
Index: src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java
===================================================================
RCS file:
/export/home/jsr166/jsr166/jsr166/src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java,v
retrieving revision 1.11
diff -u -U 1 -r1.11 ThrowingTasks.java
--- src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java 4
Jan 2017 04:46:19 -0000 1.11
+++ src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java 31
Jan 2017 22:39:48 -0000
@@ -174,5 +174,3 @@
     static void spinAwait(Supplier<Boolean> waitingForGodot) {
-        for (int spins = 0;;) {
-            if (waitingForGodot.get())
-                return;
+        for (int spins = 0; !waitingForGodot.get(); ) {
             if ((spins = (spins + 1) & 3) > 0) {


More information about the core-libs-dev mailing list