> On Mar 15, 2023, at 11:17 AM, Martin Pernollet 
> <[email protected]> wrote:
> 
> That would be easier to get information from the Oracle team about when the 
> bug <https://bugs.openjdk.org/browse/JDK-8289573> can be fixed in the JVM :)
> 

I looked a little at this bug.

From one it references https://bugs.openjdk.org/browse/JDK-7128597

Mike Swingler. Former Apple Swing guru

> If +[NSThread isMainThread] returns true, you can simply call your 
> initializer directly, instead of punting it onto the main thread.

Which resulted in…

Dmitry Cherepanov 

> the addition of +[NSThread isMainThread] was done at Mike's suggestion

Google turns up an old CGLGraphicsConfig in a JetBrains jdk8 jdk with what 
appears to include that fix…

if ([NSThread isMainThread]) {
      [GraphicsConfigUtil _getCGLConfigInfo: retArray];
  } else {
      [GraphicsConfigUtil performSelectorOnMainThread: 
@selector(_getCGLConfigInfo:) withObject: retArray waitUntilDone: YES];
  }

In the current jdk version of the code this is now…

   [ThreadUtilities performOnMainThreadWaiting:YES block:^(){

A inline block that is always run on the main thread. My guess is that this is 
the bug. If you are already on the main thread (-XstartOnFirstThread) you 
shouldn’t try and run this on the main thread again but should simply invoke.

I am not that familiar with Objective-C blocks to try and modify a fix that 
keeps that. But I may try to revert to the old-style separate method and see if 
it fixes.

Unless Sergey maybe thinks there is something worth them following up on at 
this point? Or knows that what I am thinking is wrong?

Reply via email to