X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1b3fdc02915a23586bf2595485db216c892f2e18..574815d2ca9adca6638515b5b658dc9afac52702:/src/bindings/java/org/simgrid/msg/Mutex.java diff --git a/src/bindings/java/org/simgrid/msg/Mutex.java b/src/bindings/java/org/simgrid/msg/Mutex.java index 503588b3dd..80f013bec1 100644 --- a/src/bindings/java/org/simgrid/msg/Mutex.java +++ b/src/bindings/java/org/simgrid/msg/Mutex.java @@ -8,7 +8,8 @@ package org.simgrid.msg; /** A mutex implemented on top of SimGrid synchronization mechanisms. * You can use it exactly the same way that you use the mutexes, * but to handle the interactions between the processes within the simulation. - * + * + * Don't mix simgrid synchronization with Java native one, or it will deadlock! */ public class Mutex { private long bind; // The C object -- don't touch it @@ -16,25 +17,19 @@ public class Mutex { public Mutex() { init(); } - @Override - protected void finalize() { - try { - nativeFinalize(); - } catch (Throwable e) { - e.printStackTrace(); - } + + protected void finalize() throws Throwable{ + nativeFinalize(); } private native void nativeFinalize(); private native void init(); public native void acquire(); public native void release(); - /** - * Class initializer, to initialize various JNI stuff - */ + /** Class initializer, to initialize various JNI stuff */ public static native void nativeInit(); static { - Msg.nativeInit(); + org.simgrid.NativeLib.nativeInit(); nativeInit(); } }