aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/JOCLJNILibLoader.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-04-24 03:10:40 +0200
committerMichael Bien <[email protected]>2010-04-24 03:10:40 +0200
commitbec58034b631656d3ec436ea350fa1652a8f9195 (patch)
treee241b0b54a0ac174284de294eb5c6046a622a6b3 /src/com/jogamp/opencl/JOCLJNILibLoader.java
parentb0f4d671bcf799884a3d3f31fbfee47f7fc6e5cb (diff)
renamed NativeLibLoader to JOCLJNILibLoader.
Diffstat (limited to 'src/com/jogamp/opencl/JOCLJNILibLoader.java')
-rw-r--r--src/com/jogamp/opencl/JOCLJNILibLoader.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/JOCLJNILibLoader.java b/src/com/jogamp/opencl/JOCLJNILibLoader.java
new file mode 100644
index 00000000..c8a05210
--- /dev/null
+++ b/src/com/jogamp/opencl/JOCLJNILibLoader.java
@@ -0,0 +1,27 @@
+package com.jogamp.opencl;
+
+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 JOCLJNILibLoader extends JNILibLoaderBase {
+
+ /**
+ * 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 NativeLibrary.open("OpenCL", JOCLJNILibLoader.class.getClassLoader());
+ }
+ });
+ }
+}