<AWT Dev> [8] Review request for 8005465: [macosx] Evaluate if checking for the -XstartOnFirstThread is still needed in awt.m

Artem Ananiev artem.ananiev at oracle.com
Wed Jan 16 06:24:27 PST 2013

On 1/15/2013 8:27 PM, Anthony Petrov wrote:
> Hi Artem,
> I've split the setUpAWTAppKit() to setUpAWTAppKit() and
> setUpAppKitThreadName() (and also a separate call to
> NSSetUncaughtExceptionHandler() in the very beginning of -starter:.) If
> you examine the logic in starter: carefully, you may notice that all the
> required operations are performed just as before based on the current
> mode of execution.

Before the fix, setUpAWTAppKit() is called from -starter: regardless of 
"headless" value.

After the fix, setUpAppKitThreadName() is called in headless mode, and 
both setUpAWTAppKit() and setUpAppKitThreadName() in headful mode.

The difference is than after the fix we don't add loop observers in 
headless mode. Is it intentional?



> In particular, in the headless mode we want to only set the AppKit
> thread name and only if we're not running in the "swt compatible mode".
> We don't use observers in the headless mode. Also, the uncaught
> exception handler is always set unconditionally.
> --
> best regards,
> Anthony
> On 1/15/2013 20:11, Artem Ananiev wrote:
>> Hi, Anthony,
>> after the fix, setUpAWTAppKit() is not called in headless mode, while
>> it was before. Could it be a problem?
>> Thanks,
>> Artem
>> On 1/15/2013 7:54 PM, Anthony Petrov wrote:
>>> Hello,
>>> After discussing this fix off-line, we decided to start off with a
>>> minimal version of the fix that enables FX and AWT to run in headful
>>> mode, and be able to be initialized in any order. The new fix for
>>> http://bugs.sun.com/view_bug.do?bug_id=8005465 is at:
>>> http://cr.openjdk.java.net/~anthony/8-53-startOnFirstThreadCheck-minimal-8005465.0/
>>> There's some cleanup of the initialization procedure of AWT that makes
>>> it easier to follow. The most essential change is that AWT no longer
>>> throws an exception if it's started on the main thread and the
>>> -XstartOnMainThread hasn't been specified when running the app. This is
>>> to allow one to initialize the AWT from the AppKit thread (which is the
>>> FX User Thread on the Mac).
>>> There are still a few issues remain (specifically, 8006320 and 8006326),
>>> but they may require more time to investigate, and we need to back-port
>>> this fix to a 7 update release as soon as possible.
>>> The fix has been tested with FX for the desired use-case, as well as
>>> with SWT (thanks Petr!). No problems found.
>>> --
>>> best regards,
>>> Anthony

More information about the awt-dev mailing list