Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the handling of errors in Task.send
[simgrid.git] / org / simgrid / msg / Mutex.java
index bf0bac7..b88e4d2 100644 (file)
@@ -16,7 +16,21 @@ public class Mutex {
        public Mutex(int capa) {
                init(capa);
        }
+       protected void finalize() {
+               exit();
+       }
+       private native void exit();
        private native void init(int capacity);
        public native void acquire();
        public native void release();
+       
+       /**
+        * Class initializer, to initialize various JNI stuff
+        */
+       public static native void nativeInit();
+       static {
+               nativeInit();
+       }       
 }
+
+