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

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 7
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: