Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[java] unpack dll/so to a tempDir instead of messing with their name
[simgrid.git] / src / bindings / java / org / simgrid / msg / Semaphore.java
index d74a8bc..0172aa3 100644 (file)
@@ -65,20 +65,22 @@ public class Semaphore {
        }
 
 
-       /** Deletes this semaphore 
-        */
+       /** Deletes this semaphore when the GC reclaims it */
+       @Override
        protected void finalize() {
-               destroy();
+               try {
+                       nativeFinalize();
+               } catch (Throwable e) {
+                       e.printStackTrace();
+               }
        }
-       /** The native implementation for destroying a semaphore
-        */
-       private native void destroy();
+       private native void nativeFinalize();
        /**
         * Class initializer, to initialize various JNI stuff
         */
        public static native void nativeInit();
        static {
-               Msg.nativeInit();
+               org.simgrid.NativeLib.nativeInit();
                nativeInit();
        }
 }
\ No newline at end of file