summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-20 04:58:01 +0200
committerSven Gothel <[email protected]>2011-09-20 04:58:01 +0200
commitb12fe7f98a9b523129c310d46698f430d17a8138 (patch)
tree9579477c1e7ecc65062e714c5957bba8e0b23b21 /src/java/com/jogamp
parentf357a00e511f0049865392adecc4d042663da6e6 (diff)
Remove redundant: NativeLibrary.ensureNativeLibLoaded()
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r--src/java/com/jogamp/common/jvm/JVMUtil.java3
-rw-r--r--src/java/com/jogamp/common/nio/AbstractBuffer.java3
-rw-r--r--src/java/com/jogamp/common/nio/PointerBuffer.java3
-rwxr-xr-xsrc/java/com/jogamp/common/os/NativeLibrary.java17
-rwxr-xr-xsrc/java/com/jogamp/gluegen/runtime/NativeLibLoader.java1
5 files changed, 10 insertions, 17 deletions
diff --git a/src/java/com/jogamp/common/jvm/JVMUtil.java b/src/java/com/jogamp/common/jvm/JVMUtil.java
index fda7f74..8657ae8 100644
--- a/src/java/com/jogamp/common/jvm/JVMUtil.java
+++ b/src/java/com/jogamp/common/jvm/JVMUtil.java
@@ -34,6 +34,8 @@ package com.jogamp.common.jvm;
import java.nio.ByteBuffer;
import com.jogamp.common.nio.Buffers;
+import com.jogamp.common.os.NativeLibrary;
+
import jogamp.common.Debug;
import com.jogamp.gluegen.runtime.NativeLibLoader;
@@ -52,7 +54,6 @@ public class JVMUtil {
private static final boolean DEBUG = Debug.debug("JVMUtil");
static {
- // JNILibLoaderBase.loadLibrary("jvm", null, false);
NativeLibLoader.loadGlueGenRT();
ByteBuffer buffer = Buffers.newDirectByteBuffer(64);
diff --git a/src/java/com/jogamp/common/nio/AbstractBuffer.java b/src/java/com/jogamp/common/nio/AbstractBuffer.java
index 58bab65..1d99767 100644
--- a/src/java/com/jogamp/common/nio/AbstractBuffer.java
+++ b/src/java/com/jogamp/common/nio/AbstractBuffer.java
@@ -32,6 +32,7 @@
package com.jogamp.common.nio;
import com.jogamp.common.os.*;
+import com.jogamp.gluegen.runtime.NativeLibLoader;
import java.nio.Buffer;
import java.nio.ByteBuffer;
@@ -48,7 +49,7 @@ public abstract class AbstractBuffer<B extends AbstractBuffer> implements Native
protected int position;
static {
- NativeLibrary.ensureNativeLibLoaded();
+ NativeLibLoader.loadGlueGenRT();
}
/**
diff --git a/src/java/com/jogamp/common/nio/PointerBuffer.java b/src/java/com/jogamp/common/nio/PointerBuffer.java
index 089b8b1..27a0bc6 100644
--- a/src/java/com/jogamp/common/nio/PointerBuffer.java
+++ b/src/java/com/jogamp/common/nio/PointerBuffer.java
@@ -39,6 +39,7 @@ import java.nio.LongBuffer;
import com.jogamp.common.os.NativeLibrary;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.LongObjectHashMap;
+import com.jogamp.gluegen.runtime.NativeLibLoader;
/**
* Hardware independent container for native pointer arrays.
@@ -54,7 +55,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
protected LongObjectHashMap dataMap = null;
static {
- NativeLibrary.ensureNativeLibLoaded();
+ NativeLibLoader.loadGlueGenRT();
}
/** no backup array, use for direct usage only */
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java
index f5c3264..beee639 100755
--- a/src/java/com/jogamp/common/os/NativeLibrary.java
+++ b/src/java/com/jogamp/common/os/NativeLibrary.java
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- *
+ * Copyright (c) 2011 JogAmp Community. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
@@ -174,7 +175,7 @@ public class NativeLibrary implements DynamicLookupHelper {
if (DEBUG) {
System.err.println("Trying to load " + path);
}
- ensureNativeLibLoaded();
+ NativeLibLoader.loadGlueGenRT();
long res;
if(global) {
res = dynLink.openLibraryGlobal(path, DEBUG);
@@ -445,16 +446,4 @@ public class NativeLibrary implements DynamicLookupHelper {
}
return null;
}
-
- private static volatile boolean loadedDynLinkNativeLib;
- public static void ensureNativeLibLoaded() {
- if (!loadedDynLinkNativeLib) { // volatile: ok
- synchronized (NativeLibrary.class) {
- if (!loadedDynLinkNativeLib) {
- loadedDynLinkNativeLib = true;
- NativeLibLoader.loadGlueGenRT();
- }
- }
- }
- }
}
diff --git a/src/java/com/jogamp/gluegen/runtime/NativeLibLoader.java b/src/java/com/jogamp/gluegen/runtime/NativeLibLoader.java
index 4e27c66..9e56d37 100755
--- a/src/java/com/jogamp/gluegen/runtime/NativeLibLoader.java
+++ b/src/java/com/jogamp/gluegen/runtime/NativeLibLoader.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2011 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are