Re: OS/X Java native bug

2023-03-17 Thread Saagar Jha via Cocoa-dev
The implementation of -[ThreadUtilities performOnMainThreadWaiting:block:] does the right thing here, which is calling the block directly if it’s already running on the main thread:

OS/X Java native bug

2023-03-17 Thread Michael Hall via Cocoa-dev
This was just brought to my attention on a java mailing list. An option was added to java startup options on OS/X -XstartOnFirstThread so the code starts on the main Appkit thread. Currently if a java Swing application starts with that option it hangs.

Re: OS/X Java native bug

2023-03-17 Thread Michael Hall via Cocoa-dev
> On Mar 17, 2023, at 4:07 AM, Saagar Jha wrote: > > The implementation of -[ThreadUtilities performOnMainThreadWaiting:block:] > does the right thing here, which is calling the block directly if it’s > already running on the main thread: >

Re: OS/X Java native bug

2023-03-17 Thread Michael Hall via Cocoa-dev
> On Mar 17, 2023, at 6:31 AM, Michael Hall wrote: > > > >> On Mar 17, 2023, at 4:07 AM, Saagar Jha wrote: >> >> The implementation of -[ThreadUtilities performOnMainThreadWaiting:block:] >> does the right thing here, which is calling the block directly if it’s >> already running on the

Re: OS/X Java native bug

2023-03-17 Thread Michael Hall via Cocoa-dev
> On Mar 17, 2023, at 6:51 AM, Michael Hall wrote: > >> > > Sorry, I looked at your link and am still not sure this is correct if you are > already on the main thread. > Searching shows this used enough places you would think it has to be correct. Again, I guess maybe I’ll try a little

Re: OS/X Java native bug

2023-03-17 Thread Michael Hall via Cocoa-dev
> On Mar 17, 2023, at 7:49 AM, Alan Snyder wrote: > > block() means invoke the block > >> On Mar 17, 2023, at 5:34 AM, Michael Hall via Cocoa-dev >> wrote: >> >> >> >>> On Mar 17, 2023, at 6:51 AM, Michael Hall wrote: >>> >>> >>> Sorry, I looked at your link and am still not