summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/NativeLibLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp/opencl/NativeLibLoader.java')
-rw-r--r--src/com/jogamp/opencl/NativeLibLoader.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/jogamp/opencl/NativeLibLoader.java b/src/com/jogamp/opencl/NativeLibLoader.java
index 2761cb3c..5cce1a36 100644
--- a/src/com/jogamp/opencl/NativeLibLoader.java
+++ b/src/com/jogamp/opencl/NativeLibLoader.java
@@ -1,20 +1,26 @@
package com.jogamp.opencl;
-import java.security.AccessController;
import java.security.PrivilegedAction;
import com.jogamp.common.jvm.JNILibLoaderBase;
+import com.jogamp.common.os.NativeLibrary;
+
+import static java.security.AccessController.*;
/**
- *
+ * Responsible for JOCL lib loading.
* @author Michael Bien
*/
class NativeLibLoader extends JNILibLoaderBase {
- public static void loadJOCL() {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
+ /**
+ * Loads the native binding and returns the OpenCL library for dynamic linking.
+ */
+ static NativeLibrary loadJOCL() {
+
+ return doPrivileged(new PrivilegedAction<NativeLibrary>() {
+ public NativeLibrary run() {
loadLibrary("jocl", null, true);
- return null;
+ return NativeLibrary.open("OpenCL", NativeLibLoader.class.getClassLoader());
}
});
}