HADOOP-14214. DomainSocketWatcher::add()/delete() should not self interrupt while looping await(). Contributed by Mingliang Liu

This commit is contained in:
Mingliang Liu 2017-03-23 11:33:06 -07:00
parent c55195588f
commit d35e79abc2
1 changed files with 2 additions and 10 deletions

View File

@ -321,11 +321,7 @@ public void add(DomainSocket sock, Handler handler) {
toAdd.add(entry);
kick();
while (true) {
try {
processedCond.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
processedCond.awaitUninterruptibly();
if (!toAdd.contains(entry)) {
break;
}
@ -347,11 +343,7 @@ public void remove(DomainSocket sock) {
toRemove.put(sock.fd, sock);
kick();
while (true) {
try {
processedCond.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
processedCond.awaitUninterruptibly();
if (!toRemove.containsKey(sock.fd)) {
break;
}