Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless fields in Msg
[simgrid.git] / org / simgrid / msg / Mutex.java
1 package org.simgrid.msg;
2 /** A mutex  implemented on top of SimGrid synchronization mechanisms. 
3  * You can use it exactly the same way that you use the mutexes, 
4  * but to handle the interactions between the threads within the simulation.   
5  * 
6  * Copyright 2012 The SimGrid team. All right reserved. 
7  *
8  * This program is free software; you can redistribute 
9  * it and/or modify it under the terms of the license 
10  * (GNU LGPL) which comes with this package.
11  *
12  */
13 public class Mutex {
14         private long bind; // The C object -- don't touch it
15         
16         public Mutex(int capa) {
17                 init(capa);
18         }
19         protected void finalize() {
20                 exit();
21         }
22         private native void exit();
23         private native void init(int capacity);
24         public native void acquire();
25         public native void release();
26         
27         /**
28          * Class initializer, to initialize various JNI stuff
29          */
30         public static native void nativeInit();
31         static {
32                 nativeInit();
33         }       
34 }
35
36