changeset 192:e594b663ed53

8129773: [UART] Don't start waiting procedure if timeout is 0 Summary: Add check timeout > 0 Reviewed-by: snazarki Contributed-by: olga.milovskaya@oracle.com
author snazarki
date Tue, 07 Jul 2015 17:58:01 +0300
parents 9459baa5fe9f
children f9e44621e638
files src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Jul 07 13:10:20 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Jul 07 17:58:01 2015 +0300
@@ -727,7 +727,7 @@
                 int readRes = read0(dst);
                 shiftBufferPosition(dst, ret + readRes);
                 if ((0 == receiveTriggerLevel || readRes < receiveTriggerLevel) && dst.hasRemaining()) {
-                    if (!EventQueueManager.getInstance().isDispatchThread()) {
+                    if (!EventQueueManager.getInstance().isDispatchThread() && inputTimeout > 0) {
                         /*
                          * the user calls read() from the event callback, or inputTimeout is 0
                          * exit immediatelly,