summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-09-30 20:33:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-30 20:33:48 +0000
commitd63902f3b8cf1b6d4b96f9e856e5958ad538da5c (patch)
treebdd1e13bb374da50909aa9cc4bf1a2ad073ba2db
parent5d323f2670e5fa7f60e55fe5e9de5d7c3cd33105 (diff)
parentdd303ca9af64bda1a503d9918ec17a61e9b06e6d (diff)
downloadlibcore-d63902f3b8cf1b6d4b96f9e856e5958ad538da5c.zip
libcore-d63902f3b8cf1b6d4b96f9e856e5958ad538da5c.tar.gz
libcore-d63902f3b8cf1b6d4b96f9e856e5958ad538da5c.tar.bz2
am dd303ca9: Patch for awaitNanos() for coarse-grained clocks
* commit 'dd303ca9af64bda1a503d9918ec17a61e9b06e6d': Patch for awaitNanos() for coarse-grained clocks
-rw-r--r--luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java5
-rw-r--r--luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java5
2 files changed, 8 insertions, 2 deletions
diff --git a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
index 47a02a9..a74fb24 100644
--- a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
+++ b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
@@ -1838,7 +1838,10 @@ public abstract class AbstractQueuedLongSynchronizer
if (interruptMode != 0)
reportInterruptAfterWait(interruptMode);
long remaining = deadline - System.nanoTime(); // avoid overflow
- return (remaining < initialNanos) ? remaining : Long.MIN_VALUE;
+ // BEGIN android-note Changed from < to <= http://b/24284239
+ // return (remaining < initialNanos) ? remaining : Long.MIN_VALUE;
+ return (remaining <= initialNanos) ? remaining : Long.MIN_VALUE;
+ // END android-note
}
/**
diff --git a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
index bfe88e5..8823b6f 100644
--- a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
+++ b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
@@ -2062,7 +2062,10 @@ public abstract class AbstractQueuedSynchronizer
if (interruptMode != 0)
reportInterruptAfterWait(interruptMode);
long remaining = deadline - System.nanoTime(); // avoid overflow
- return (remaining < initialNanos) ? remaining : Long.MIN_VALUE;
+ // BEGIN android-note Changed from < to <= http://b/24284239
+ // return (remaining < initialNanos) ? remaining : Long.MIN_VALUE;
+ return (remaining <= initialNanos) ? remaining : Long.MIN_VALUE;
+ // END android-note
}
/**