Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ensures that the native libraries are always loaded before trying to access them
[simgrid.git] / org / simgrid / msg / Comm.java
index 423371d..63e6d1e 100644 (file)
@@ -25,11 +25,11 @@ public class Comm {
         * native C comm. You must never access it, since it is 
         * automatically set.
         */
-       public long bind = 0;
+       private long bind = 0;
        /**
         * Represents the bind for the task object pointer. Don't touch it.
         */
-       public long taskBind = 0;
+       private long taskBind = 0;
        /**
         * Task associated with the comm. Beware, it can be null 
         */
@@ -57,11 +57,19 @@ public class Comm {
         * raise an exception.
         */
        public native boolean test() throws TransferFailureException, HostFailureException, TimeoutException ;
+       /**
+        * Wait for the complemetion of the communication for an indefinite time
+        */
+       public void waitCompletion() throws TransferFailureException, HostFailureException, TimeoutException {
+               waitCompletion(-1);
+       }
        /**
         * Wait for the completion of the communication.
         * Throws an exception if there were an error in the communication.
+        * @param timeout Time before giving up
         */
        public native void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
+               
        /**
         * Returns the task associated with the communication.
         * if the communication isn't finished yet, will return null.
@@ -75,6 +83,7 @@ public class Comm {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }       
 }