X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/78224183a24a35d071d26d0653d7d3c196b131e6..9e0cc75839bb97e7c5a4c25ed97dc53c8acdb011:/org/simgrid/msg/Mutex.java diff --git a/org/simgrid/msg/Mutex.java b/org/simgrid/msg/Mutex.java index 5f88151904..cb16ffb03f 100644 --- a/org/simgrid/msg/Mutex.java +++ b/org/simgrid/msg/Mutex.java @@ -1,8 +1,4 @@ -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 threads within the simulation. - * +/* * Copyright 2012 The SimGrid team. All right reserved. * * This program is free software; you can redistribute @@ -10,18 +6,34 @@ package org.simgrid.msg; * (GNU LGPL) which comes with this package. * */ +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. + * + */ public class Mutex { private long bind; // The C object -- don't touch it - public Mutex(int capa) { - init(capa); + public Mutex() { + init(); } protected void finalize() { exit(); } private native void exit(); - private native void init(int capacity); + private native void init(); public native void acquire(); public native void release(); + /** + * Class initializer, to initialize various JNI stuff + */ + public static native void nativeInit(); + static { + Msg.nativeInit(); + nativeInit(); + } } + +