Jogamp
Fix synchronization issues in Animator* Exception case v2.2.2
authorSven Gothel <sgothel@jausoft.com>
Tue, 23 Sep 2014 01:56:04 +0000 (03:56 +0200)
committerSven Gothel <sgothel@jausoft.com>
Tue, 23 Sep 2014 01:57:05 +0000 (03:57 +0200)
commit8e9407ab74f672c2a0d1e196a3ba2e7d8743debf
tree827d4f0dd8973ec19d31338b239eb52a6352cf04
parent2fc3a60ed01501727f0645f35ffe75eb56a32aec
Fix synchronization issues in Animator* Exception case

Refines commit cef7ba607ad7e8eb1ff2a438d77710a29aa0bda6

- The animator monitor-lock was still hold in the post finally block
  issuing flushGLRunnables(), due to intrinsic monitor release (in finally):
   - <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.11.10>
   - <http://stackoverflow.com/questions/10743285/behavior-of-a-synchronized-method-with-try-and-finally>

- Further: AnimatorBase.flushGLRunnables() acquired the lock itself (duh!)

This commit removes the requirement for finally altogether
by simply return a boolean from handleUncaughtException(caughtException),
where false denotes the caller to propagate the exception itself (no handler).

Post synchronized block then issues flushGLRunnables() and
exceptation propagation as required.

AnimatorBase.flushGLRunnables() 'synchronized' modifier is removed.

Further, ThreadDeath is being propagated if caught.
Here the finally block is also removed - redundant.
src/jogl/classes/com/jogamp/opengl/util/Animator.java
src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
http://JogAmp.org git info: FAQ, tutorial and man pages.