summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
committerSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
commit556d92b63555a085b25e32b1cd55afce24edd07a (patch)
tree6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
parenta90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/SharedResourceRunner.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/SharedResourceRunner.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index 1688d1044..93a4eb32e 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -89,17 +89,17 @@ public class SharedResourceRunner implements Runnable {
String initConnection;
String releaseConnection;
- private boolean getDeviceTried(String connection) { // synchronized call
+ private boolean getDeviceTried(final String connection) { // synchronized call
return devicesTried.contains(connection);
}
- private void addDeviceTried(String connection) { // synchronized call
+ private void addDeviceTried(final String connection) { // synchronized call
devicesTried.add(connection);
}
- private void removeDeviceTried(String connection) { // synchronized call
+ private void removeDeviceTried(final String connection) { // synchronized call
devicesTried.remove(connection);
}
- public SharedResourceRunner(Implementation impl) {
+ public SharedResourceRunner(final Implementation impl) {
this.impl = impl;
resetState();
}
@@ -144,7 +144,7 @@ public class SharedResourceRunner implements Runnable {
while (!running) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
}
}
@@ -164,14 +164,14 @@ public class SharedResourceRunner implements Runnable {
while (running) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
}
}
}
}
- public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
+ public SharedResourceRunner.Resource getOrCreateShared(final AbstractGraphicsDevice device) {
SharedResourceRunner.Resource sr = null;
if(null != device) {
synchronized (this) {
@@ -198,7 +198,7 @@ public class SharedResourceRunner implements Runnable {
return sr;
}
- public SharedResourceRunner.Resource releaseShared(AbstractGraphicsDevice device) {
+ public SharedResourceRunner.Resource releaseShared(final AbstractGraphicsDevice device) {
SharedResourceRunner.Resource sr = null;
if(null != device) {
synchronized (this) {
@@ -219,7 +219,7 @@ public class SharedResourceRunner implements Runnable {
return sr;
}
- private final void doAndWait(String initConnection, String releaseConnection) {
+ private final void doAndWait(final String initConnection, final String releaseConnection) {
synchronized (this) {
// wait until thread becomes ready to init new device,
// pass the device and release the sync
@@ -230,7 +230,7 @@ public class SharedResourceRunner implements Runnable {
while (!ready && running) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
if (DEBUG) {
System.err.println("SharedResourceRunner.doAndWait() set command: " + initConnection + ", release: "+releaseConnection+" - "+threadName);
@@ -243,7 +243,7 @@ public class SharedResourceRunner implements Runnable {
while ( running && ( !ready || null != this.initConnection || null != this.releaseConnection ) ) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
if (DEBUG) {
System.err.println("SharedResourceRunner.initializeAndWait END init: " + initConnection + ", release: "+releaseConnection+" - "+threadName);
@@ -272,7 +272,7 @@ public class SharedResourceRunner implements Runnable {
}
notifyAll();
this.wait();
- } catch (InterruptedException ex) {
+ } catch (final InterruptedException ex) {
shouldRelease = true;
if(DEBUG) {
System.err.println("SharedResourceRunner.run(): INTERRUPTED - "+threadName);
@@ -293,7 +293,7 @@ public class SharedResourceRunner implements Runnable {
Resource sr = null;
try {
sr = impl.createSharedResource(initConnection);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
if (null != sr) {
@@ -304,12 +304,12 @@ public class SharedResourceRunner implements Runnable {
if (DEBUG) {
System.err.println("SharedResourceRunner.run(): release Shared for: " + releaseConnection + " - " + threadName);
}
- Resource sr = impl.mapGet(releaseConnection);
+ final Resource sr = impl.mapGet(releaseConnection);
if (null != sr) {
try {
impl.releaseSharedResource(sr);
impl.mapPut(releaseConnection, null);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -338,11 +338,11 @@ public class SharedResourceRunner implements Runnable {
private void releaseSharedResources() { // synchronized call
devicesTried.clear();
- Collection<Resource> sharedResources = impl.mapValues();
- for (Iterator<Resource> iter = sharedResources.iterator(); iter.hasNext();) {
+ final Collection<Resource> sharedResources = impl.mapValues();
+ for (final Iterator<Resource> iter = sharedResources.iterator(); iter.hasNext();) {
try {
impl.releaseSharedResource(iter.next());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
System.err.println("Caught exception on thread "+getThreadName());
t.printStackTrace();
}