1 /* Copyright (c) 2012-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 package org.simgrid.msg;
8 /** A mutex implemented on top of SimGrid synchronization mechanisms.
9 * You can use it exactly the same way that you use the mutexes,
10 * but to handle the interactions between the processes within the simulation.
12 * Don't mix simgrid synchronization with Java native one, or it will deadlock!
15 private long bind; // The C object -- don't touch it
21 protected void finalize() throws Throwable {
24 private native void nativeFinalize();
25 private native void init();
26 public native void acquire();
27 public native void release();
29 /** Class initializer, to initialize various JNI stuff */
30 public static native void nativeInit();
32 org.simgrid.NativeLib.nativeInit();