Skip to content

Commit

Permalink
AnimatorBase thread-name: Add instance sequence number
Browse files Browse the repository at this point in the history
  • Loading branch information
sgothel committed Oct 8, 2014
1 parent e192f05 commit 4b2552a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
Expand Up @@ -89,6 +89,8 @@ public static interface AnimatorImpl {
boolean blockUntilDone(final Thread thread);
}

private static int seqInstanceNumber = 0;

protected int modeBits;
protected AnimatorImpl impl;
protected String baseName;
Expand Down Expand Up @@ -146,15 +148,16 @@ private static final boolean useAWTAnimatorImpl(final int modeBits) {
*/
protected final synchronized void initImpl(final boolean force) {
if( force || null == impl ) {
final String seqSuffix = String.format("#%02d", seqInstanceNumber++);
if( useAWTAnimatorImpl( modeBits ) ) {
try {
impl = (AnimatorImpl) awtAnimatorImplClazz.newInstance();
baseName = getBaseName("AWT");
baseName = getBaseName("AWT")+seqSuffix;
} catch (final Exception e) { e.printStackTrace(); }
}
if( null == impl ) {
impl = new DefaultAnimatorImpl();
baseName = getBaseName("");
baseName = getBaseName("")+seqSuffix;
}
if(DEBUG) {
System.err.println("Animator.initImpl: baseName "+baseName+", implClazz "+impl.getClass().getName()+" - "+toString()+" - "+getThreadName());
Expand Down

0 comments on commit 4b2552a

Please sign in to comment.