Преглед на файлове

Fix race condition in StreamCopyThread

If we get an interrupt during an IO operation (src.read or dst.write)
caused by the flush() method incrementing the flush counter, ensure
we restart the proper section of code.  Just ignore the interrupt
and continue running.

Bug: 313082
Change-Id: Ib2b37901af8141289bbac9807cacf42b4e2461bd
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.8.1
Dmitry Neverov преди 14 години
родител
ревизия
b3247ba524
променени са 1 файла, в които са добавени 2 реда и са изтрити 8 реда
  1. 2
    8
      org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java

+ 2
- 8
org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java Целия файл

@@ -100,10 +100,7 @@ public class StreamCopyThread extends Thread {
try {
n = src.read(buf);
} catch (InterruptedIOException wakey) {
if (flushCounter.get() > 0)
continue;
else
throw wakey;
continue;
}
if (n < 0)
break;
@@ -112,10 +109,7 @@ public class StreamCopyThread extends Thread {
try {
dst.write(buf, 0, n);
} catch (InterruptedIOException wakey) {
if (flushCounter.get() > 0)
continue;
else
throw wakey;
continue;
}
break;
}

Loading…
Отказ
Запис