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

java.util.concurrent.ForkJoinTask serialized form refers to package-private constants

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7
    • core-libs
    • None

      Serialized Form javadoc for java.util.concurrent.ForkJoinTask says:
        --- cut ---
        Serialized Fields
        ...
        int status

            Run control status bits packed into a single int to minimize footprint and
            to ensure atomicity (via CAS). Status is initially zero, and takes on
            nonnegative values until completed, upon which status holds COMPLETED.
            CANCELLED, or EXCEPTIONAL, which use the top 3 bits. Tasks undergoing
            blocking waits by other threads have SIGNAL_MASK bits set -- bit 15 for
            external (nonFJ) waits, and the rest a count of waiting FJ threads. (This
            representation relies on ForkJoinPool max thread limits). Completion of a
            stolen task with SIGNAL_MASK bits set awakens waiter via notifyAll. Even
            though suboptimal for some purposes, we use basic builtin wait/notify to
            take advantage of "monitor inflation" in JVMs that we would otherwise need
            to emulate to avoid adding further per-task bookkeeping overhead. Note
            that bits 16-28 are currently unused. Also value 0x80000000 is available
            as spare completion value.
        --- cut ---

      There are two issues here:
        - the constants CANCELLED, EXCEPTIONAL and SIGNAL_MASK have package-private
          access so their exact values are not available at javadoc;
        - the ForkJoinTask class does not contain a constant with name COMPLETED.

            chegar Chris Hegarty
            ygaevsky Yuri Gaevsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: