changeset 197:d56cb669f4f1

8129416: UART.read() returns even if provided buffer is not filled full Summary: totalBytesRead is reset at readAsync Reviewed-by: alkonsta
author snazarki
date Mon, 22 Jun 2015 17:07:36 +0300
parents b810492e8278
children a487953b6d66
files src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Fri Jun 19 16:38:05 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Mon Jun 22 17:07:36 2015 +0300
@@ -631,6 +631,7 @@
         checkPowerState();
         synchronized(synchReadLock){
             checkRead();
+            totalBytesRead = 0;
             inRoundListener = listener;
             readBuffers.add(src1);
             if (null != src2) {
@@ -739,6 +740,7 @@
                             }catch(InterruptedException iE){
                                 throw new IOException();
                             } finally {
+                                stopReading(true);
                             }
                     }
                 } // if !event thread