Bug 1055

Summary: Access and query shared master GLContext in a deterministic fashion ; Don't use arbitrary shared context as 'master'.
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: major CC: sgothel
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
011e13e22fd52d2e82697ffee6b4c9ca8f3d549a
Workaround: ---

Description Sven Gothel 2014-08-30 00:32:58 CEST
GLContext* passes the shared-master to GLContextShareSet,
which only creates a sets of shared contexts
without differentiating the master context.

GLContext*'s shared-slave attempts to lock 
the realized shared-master's surface at creation.

Currently only an arbitrary shared context is selected 
due to the missing 'master' identity.
The arbitrary shared context's surface is locked 
and its shared context handle used to create the slave context.

Lacking of using the user given shared-master
can lead to deadlock situations - and locking a 'wrong' surface.

+++

The fix shall:
  - Allow query the user given shared-master!

  - Use the user given shared-master for locking and it's 
    context handle for the slave's creation.

  - Constrain the shared context set to _only_ one unique master context,
    to avoid confusion - fail fast! (throw exception).
Comment 1 Sven Gothel 2014-08-30 11:57:12 CEST
(In reply to comment #0)
>   - Constrain the shared context set to _only_ one unique master context,
>     to avoid confusion - fail fast! (throw exception).

Such constraint would break compatibility with pre-existing applications
as well as restrict shared context usage (allowed in GL spec, i.e. not forbidden).

Instead, the shared-context mapping shall map each shared-master
to a shared-slave within one shared-context-set,
allowing deterministic and individual shared-master queries!
Comment 2 Sven Gothel 2014-08-30 11:59:45 CEST
commit 011e13e22fd52d2e82697ffee6b4c9ca8f3d549a
implements/fixes issue as described.