Bug 1054 - GLContext: makeCurrent() needs a null-check of [mutable] drawable; Review null checks and synchronization/locking.
Summary: GLContext: makeCurrent() needs a null-check of [mutable] drawable; Review nul...
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: All all
: --- major
Assignee: Sven Gothel
Depends on:
Reported: 2014-08-29 15:05 CEST by Sven Gothel
Modified: 2014-08-30 12:04 CEST (History)
2 users (show)

See Also:
Type: ---
SCM Refs:
ad79bd072b600a3f2416cc6f0c61e2925000069d dfb9ed47ac6d8e85f6ae5fe166e7a6e28ca8ff83 11347ad39059836f3e2a4f1fc592dc1e3fab6a09 da16dfd39cc17687808308c386d64f6206027c00
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2014-08-29 15:05:02 CEST

Comment 1 Sven Gothel 2014-08-30 00:12:13 CEST
'drawable' field of GLContextImpl is mutable via setGLDrawable(..),
which requires high-level locking as documented.

The required high-level locking allows us to _not_ add special
synchronization to this field (and drawableRead).

A simple null-check in makeCurrent() shall be sufficient,
plus ensuring mentioned high-level locking is applied.
Comment 2 Sven Gothel 2014-08-30 00:22:14 CEST

GLContextImpl 'drawable' and 'drawableRead' synchronization:
  - commit ad79bd072b600a3f2416cc6f0c61e2925000069d 
    check of null drawable is sufficient

  - Add GLAutoDrawable upstream-lock locking to:
    - AWT GLCanvas setupPrint/releasePrint
    - AWT GLJPanel (was missing)
  - validate shared-context native-surface locking, 
    throw exception if not successful

  - pixelDataEvaluated does not need to be synchronized, 
    since it's being called while context is current, locking
      - GLDrawableHelper.recreateGLDrawable(..): Remove redundant glFinish() call