changeset 152:5cd6e5117297

8080994: Async read must not be affected by receive trigger Summary: Operation type is checked at event processing loop Reviewed-by: alkonsta
author snazarki
date Mon, 25 May 2015 13:50:00 +0300
parents 6f4fbf4511c5
children 36fd4f8f325a
files src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Fri May 22 17:46:14 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Mon May 25 13:50:00 2015 +0300
@@ -226,7 +226,11 @@
 
                 }
 
-                if(!buffer.hasRemaining() || ( receiveTriggerLevel !=0 && (buffer.position() - readBuffersPositions[readBufferIdx]) >= receiveTriggerLevel) || (-1 == bytesProcessed)){
+                if(!buffer.hasRemaining()
+                   || (0 != receiveTriggerLevel &&
+                       inRoundListener instanceof InternalRoundListener &&
+                       (long)(buffer.position() - readBuffersPositions[readBufferIdx]) >= receiveTriggerLevel)
+                   || (-1 == bytesProcessed)){
                     RoundCompletionEvent<UART,ByteBuffer> rcEvent =
                         new RoundCompletionEvent(this, buffer, buffer.position() - readBuffersPositions[readBufferIdx]);