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

ForkJoinPool.commonPool().close() spins

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 19
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      None. this is a new API.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The https://bugs.openjdk.java.net/browse/JDK-8285450 spec for ExecutorService.close should have been accompanied by an override for ForkJoinPool to cover the case of the commonPool, which never terminates. Now included.

      Problem

      Missing override.

      Solution

      Added override.

      Specification

      In class ForkJoinPool:

      /**
       * Unless this is the {@link #commonPool()}, initiates an orderly
       * shutdown in which previously submitted tasks are executed, but
       * no new tasks will be accepted, and waits until all tasks have
       * completed execution and the executor has terminated.
       *
       * <p> If already terminated, or this is the {@link
       * #commonPool()}, this method has no effect on execution, and
       * does not wait. Otherwise, if interrupted while waiting, this
       * method stops all executing tasks as if by invoking {@link
       * #shutdownNow()}. It then continues to wait until all actively
       * executing tasks have completed. Tasks that were awaiting
       * execution are not executed. The interrupt status will be
       * re-asserted before this method returns.
       *
       * @throws SecurityException if a security manager exists and
       *         shutting down this ExecutorService may manipulate
       *         threads that the caller is not permitted to modify
       *         because it does not hold {@link
       *         java.lang.RuntimePermission}{@code ("modifyThread")},
       *         or the security manager's {@code checkAccess} method
       *         denies access.
       * @since 19
       */
      @Override
      public void close()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dl Doug Lea
              Reporter:
              alanb Alan Bateman
              Reviewed By:
              Alan Bateman, Joe Darcy, Martin Buchholz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: