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

java.awt.EventQueue.isDispatchThread() specification is not precise

XMLWordPrintable

    • 1.2fcs
    • sparc
    • solaris_2.5
    • Not verified



      Name: mgC56079 Date: 04/24/98



      Javadoc says:

          /**
           * Returns true if the calling thread is this EventQueue's
           * dispatch thread. Use this call the ensure that a given
           * task is being executed (or not being) on the current
           * EventDispatchThread.
           *
           * @return true if running on this EventQueue's dispatch thread.
           */
          public static boolean isDispatchThread() {
              return (Thread.currentThread() instanceof EventDispatchThread);
          }


      This is a static method so there is no _this_ EventQueue's dispatch thread.
      This method actually returns true if current thread is _any_ EventQueue's
      dispatch thread (each instance of EventQueue has separate dispatch thread).

      ======================================================================

            dgreensunw Dale Green (Inactive)
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: