• Igor Demin's avatar
    Linux fix deadlock when we close a window (#646) · dc985814
    Igor Demin authored
    Deadlock:
    [AWTThread] awtLock -> SkiaLayer.dispose -> LinuxOpenGLRedrawer.dispose -> we are here -> lockLinuxDrawingSurface -> awtLock
    [refreshRate updater thread] -> lockLinuxDrawingSurface -> we are here -> awtLock
    
    We moved refreshRate to another thread, and check it only once a second, because it is not fast. I mistakenly thought in the past, that it is very slow on Linux (2ms), but it appears it was because of the awtLock itself. In the AWT thread it take 0.2ms, that is also slow for just one functions, but bearable, if it called only once every second.
    
    Alternative is to subscribe to the native XRRScreenChangeNotifyEvent: https://www.x.org/releases/current/doc/man/man3/Xrandr.3.xhtml. But it seems X window system can have only one event queue associated with the window, and we already have one inside AWT, and we don't have access to it.
    dc985814
Name
Last commit
Last update
.github/workflows Loading commit data...
.run Loading commit data...
gradle/wrapper Loading commit data...
samples Loading commit data...
skiko Loading commit data...
.gitignore Loading commit data...
DEVELOPMENT.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle.kts Loading commit data...