mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Revert "Bug 534286. Made read(byte[],int,int) blocking"
This reverts commit e5c7bb64f7
.
Change-Id: I565f9eb2728d0ff0199e61f3f25df4aa0b64f17b
This commit is contained in:
parent
3b44424539
commit
e6550c7a10
1 changed files with 9 additions and 26 deletions
|
@ -103,10 +103,8 @@ public class SerialPort {
|
|||
rpos += n;
|
||||
return n;
|
||||
} else {
|
||||
while (isOpen()) {
|
||||
n = read1(handle, b, off, len);
|
||||
if (n <= 0 ) {
|
||||
if (isPaused) {
|
||||
if (n <= 0 && isPaused) {
|
||||
synchronized (pauseMutex) {
|
||||
while (isPaused) {
|
||||
try {
|
||||
|
@ -116,26 +114,11 @@ public class SerialPort {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (n < 0) {
|
||||
// End of stream, connection closed?
|
||||
return n;
|
||||
}
|
||||
else {
|
||||
// Nothing available yet, keep blocking
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
return read1(handle, b, off, len);
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue