Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'condvar'
[simgrid.git] / src / bindings / java / org / simgrid / msg / RngStream.java
index c7d3a5d..23e95cb 100644 (file)
@@ -41,16 +41,18 @@ public class RngStream {
         * The natively implemented method to create a C RngStream object.
         */
        private native void create(String name);
-       /**
-        * Destructor
-        */
+       @Override
        protected void finalize() {
-               destroy();
+               try {
+                       nativeFinalize();
+               } catch (Throwable e) {
+                       e.printStackTrace();
+               }
        }
        /**
         * Release the C RngStream object
         */
-       private native void destroy();
+       private native void nativeFinalize();
 
        /**
         * Sets the initial seed of the package RngStreams to the six integers in the vector seed. This will
@@ -88,8 +90,8 @@ public class RngStream {
        public native boolean setSeed(int seed[]);
        /**
         * Advances the state of the stream by k values, without modifying the states of other streams (as
-        * in RngStream_SetSeed), nor the values of Bg and Ig associated with this stream. If e > 0, then
-        * k = 2e + c; if e < 0, then k = -2-e + c; and if e = 0, then k = c. Note: c is allowed to take
+        * in RngStream_SetSeed), nor the values of Bg and Ig associated with this stream. If e &gt; 0, then
+        * k = 2e + c; if e &lt; 0, then k = -2-e + c; and if e = 0, then k = c. Note: c is allowed to take
         * negative values. We discourage the use of this procedure.     
         */
        public native void advanceState(int e, int g);
@@ -111,7 +113,7 @@ public class RngStream {
         */
        public static native void nativeInit();
        static {
-               Msg.nativeInit();
+               org.simgrid.NativeLib.nativeInit();
                nativeInit();
        }
-}
\ No newline at end of file
+}