Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge concerns - Adrien
[simgrid.git] / org / simgrid / msg / Comm.java
index 899d094..423371d 100644 (file)
@@ -15,7 +15,11 @@ public class Comm {
        /**
         * Indicates if the communication is a receiving communication
         */
-       boolean receiving;
+       protected boolean receiving;
+       /**
+        * Indicates if the communication is finished
+        */
+       protected boolean finished = false;
        /**
         * Represents the bind between the java comm and the
         * native C comm. You must never access it, since it is 
@@ -25,7 +29,7 @@ public class Comm {
        /**
         * Represents the bind for the task object pointer. Don't touch it.
         */
-       public long bindTask = 0;
+       public long taskBind = 0;
        /**
         * Task associated with the comm. Beware, it can be null 
         */
@@ -41,12 +45,12 @@ public class Comm {
         * Finalize the communication object, destroying it.
         */
        protected void finalize() throws Throwable {
-               unbind();
+               destroy();
        }
        /**
         * Unbind the communication object
         */
-       public native void unbind() throws NativeException;
+       protected native void destroy() throws NativeException;
        /**
         * Returns if the communication is finished or not.
         * If the communication has finished and there was an error,
@@ -65,5 +69,12 @@ public class Comm {
        public Task getTask() {
                return task;
        }
-       
+
+       /**
+        * Class initializer, to initialize various JNI stuff
+        */
+       public static native void nativeInit();
+       static {
+               nativeInit();
+       }       
 }