X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6bee07c05481cf59f8e8dbaff46629af3d254c06..f449557885f5b949b9f52b1c3fa1395571c08857:/org/simgrid/msg/Msg.java diff --git a/org/simgrid/msg/Msg.java b/org/simgrid/msg/Msg.java index ba290f864a..d722813945 100644 --- a/org/simgrid/msg/Msg.java +++ b/org/simgrid/msg/Msg.java @@ -19,7 +19,10 @@ import java.io.File; public final class Msg { /* Statically load the library which contains all native functions used in here */ - static { + static private boolean isNativeInited = false; + public static void nativeInit() { + if (isNativeInited) + return; try { /* prefer the version on disk, if existing */ System.loadLibrary("SG_java"); @@ -28,6 +31,10 @@ public final class Msg { loadLib("simgrid"); loadLib("SG_java"); } + isNativeInited = true; + } + static { + nativeInit(); } private static void loadLib (String name) { String Path = "NATIVE/"+System.getProperty("os.name")+"/"+System.getProperty("os.arch")+"/";