JDK-7179050 : [macosx] Make LWAWT be able to run on AppKit thread
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-06-22
  • Updated: 2014-10-15
  • Resolved: 2013-01-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u40Fixed 8 b75Fixed
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:


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.

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.

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.