Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6317750

remove sun.awt.motif.AWTLockAccess in favor of SunToolkit entrypoints

XMLWordPrintable

    • b62
    • generic
    • solaris_9

      As part of the changes for 6253009, we promoted the XToolkit.awtLock() and related
      methods up into SunToolkit so that they can be called independent of the current
      toolkit (or from shared code, as in the OGL case). It appears that we have a class
      called sun.awt.motif.AWTLockAccess with static methods just like the ones in
      XToolkit (now in SunToolkit). These methods in AWTLockAccess call down to JNI and
      invoke the AWT_LOCK() and similar macros.

      This approach in AWTLockAccess is probably a bit slower than using the equivalent
      methods in SunToolkit, which use Unsafe.monitorEnter() (as of b51 and earlier).
      However, in 6317330 we are proposing to replace the Unsafe-based implementations
      of these methods with ReentrantLock for improved performance. If we go with that
      change, then not only does the AWTLockAccess class become obsolete, it becomes a
      performance issue because a call to awtLock() for example will look like:
          AWTLockAccess.awtLock()
              JNI downcall to AWT_LOCK()
                  JNI upcall to SunToolkit.awtLock()
                      call into ReentrantLock.lock()...

      Therefore, we should eliminate AWTLockAccess altogether and replace calls with
      their SunToolkit equivalents.

            dav Andrei Dmitriev (Inactive)
            campbell Christopher Campbell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: