changeset 110:6b1ef3cdc4f4

8073551: Some tests in DIO VTS 1.0.1 fail due to IllegalStateException and IllegalMonitorStateException Summary: Removed unnecessary notifyAll() and fix transaction completion routine Reviewed-by: alkonsta
author snazarki
date Wed, 25 Feb 2015 12:39:11 +0300
parents f7d96bd932d8
children 2f025f4bfa0a
files src/share/classes/com/oracle/dio/spibus/impl/SPICompositeMessageImpl.java src/share/classes/com/oracle/dio/spibus/impl/SPISlaveImpl.java src/share/classes/jdk/dio/spibus/SPICompositeMessage.java
diffstat 3 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/spibus/impl/SPICompositeMessageImpl.java	Tue Feb 24 15:26:06 2015 +0300
+++ b/src/share/classes/com/oracle/dio/spibus/impl/SPICompositeMessageImpl.java	Wed Feb 25 12:39:11 2015 +0300
@@ -81,8 +81,8 @@
             ByteBuffer tx = messageList.get(i).tx;
             ByteBuffer rx = messageList.get(i).rx;
             if (    (null != tx && (tx == message.tx ||
-                                    rx == message.tx) )
-                 || (null != rx && (tx == message.rx ||
+                                    tx == message.rx) )
+                 || (null != rx && (rx == message.tx ||
                                     rx == message.rx ) ) ) {
                 throw new IllegalArgumentException(
                     ExceptionMessage.format(ExceptionMessage.I2CBUS_BUFFER_GIVEN_TWICE)
@@ -155,7 +155,6 @@
             /* Forbid adding more messages to this combined message */
             isAlreadyTransferedOnce = true;
             if (0 == messageList.size()) {
-                notifyAll();
                 return null;
             }
 
@@ -175,7 +174,6 @@
 
             } finally {
                 device.endTransaction(transaction);
-                notifyAll();
             }
 
         }
--- a/src/share/classes/com/oracle/dio/spibus/impl/SPISlaveImpl.java	Tue Feb 24 15:26:06 2015 +0300
+++ b/src/share/classes/com/oracle/dio/spibus/impl/SPISlaveImpl.java	Wed Feb 25 12:39:11 2015 +0300
@@ -335,7 +335,7 @@
         */
         synchronized(handle){
 
-        final boolean trStart = combined && transaction != Transaction.REGULAR_MESSAGE;
+        final boolean trStart = combined && transaction == Transaction.REGULAR_MESSAGE;
 
         if (trStart) {
             // can throw ISE
@@ -462,7 +462,7 @@
         // it is enough to separate transactions in scope of current application enviroment.
         // the rest is cared by javacall
         synchronized(SPISlaveImpl.class) {
-            return trans_counter++;
+            return (transaction = trans_counter++);
         }
     }
 
--- a/src/share/classes/jdk/dio/spibus/SPICompositeMessage.java	Tue Feb 24 15:26:06 2015 +0300
+++ b/src/share/classes/jdk/dio/spibus/SPICompositeMessage.java	Wed Feb 25 12:39:11 2015 +0300
@@ -58,6 +58,7 @@
  *
  * @since 1.0.1
  */
+@apimarker.API("device-io_1.1_spibus")
 public interface SPICompositeMessage {
 
     /**