Login  Register

AWTUtil.lockToolkit

classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

AWTUtil.lockToolkit

Christophe LAFOLET
This post was updated on Feb 17, 2022; 11:58am.
I'm using JOGL 2.3.2 with Swing/AWT ( property sun.java2d.opengl=true )

I have several threads which call simultaneously Java2D.invokeWithOGLSharedContextCurrent() or Java2D.invokeWithOGLContextCurrent().

The first thread set AWTUtil.lockedToolkit to true
The others threads get a GLException "Toolkit already locked"

In my context, SunToolkit.awtLock() is called
So, why do we need the static AWTUtil.lockedToolkit ?

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: AWTUtil.lockToolkit

gouessej
Administrator
Sorry for the late reply. Several threads shouldn't call that simultaneously. Have you tried to use invokeAndWait?
Julien Gouesse | Personal blog | Website