United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7179050 [macosx] Make LWAWT be able to run on AppKit thread
JDK-7179050 : [macosx] Make LWAWT be able to run on AppKit thread

Details
Type:
Enhancement
Submit Date:
2012-06-22
Status:
Resolved
Updated Date:
2013-12-06
Project Name:
JDK
Resolved Date:
2013-01-18
Component:
client-libs
OS:
generic
Sub-Component:
java.awt
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:

Related Reports
Backport:
Backport:

Sub Tasks

Description
Right now, most, if not all, native methods in LWAWT are called on event dispatch thread or other Java threads. In native, these methods contain the threading check:

    AWT_ASSERT_NOT_APPKIT_THREAD;

However, these checks are mostly unnecessary since a user application just can't access the AppKit thread managed by AWT native code. Therefore these methods are always called from non-AppKit thread just by code design. These checks only consume memory and CPU resources. Also, for experimental purposes it may be useful to call some of these methods from the AppKit thread sometimes, in which case the checks do a bad job.

                                    

Comments
EVALUATION

We need to remove the assertions from the native code, and dispatch the code to the AppKit thread if a method is invoked on a non-AppKit thread.
                                     
2012-06-22
URL:   http://hg.openjdk.java.net/jdk8/awt/jdk/rev/5309fed435b5
User:  serb
Date:  2013-01-18 14:19:45 +0000

                                     
2013-01-18
noreg-hard: the fix changes the code to which user apps don't have direct access to. Therefore, it's impossible to create a regression test for this issue. As long as GUI apps run on Mac, consider this fix verified.
                                     
2013-08-23
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/5309fed435b5
User:  lana
Date:  2013-01-30 16:42:16 +0000

                                     
2013-01-30



Hardware and Software, Engineered to Work Together