jdk/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java
changeset 7518 0282db800fe1
parent 5506 202f599c92aa
child 7976 f273c0d04215
equal deleted inserted replaced
7517:7303bc0e78d6 7518:0282db800fe1
    60  * this, set {@link #setRemoveOnCancelPolicy} to {@code true}, which
    60  * this, set {@link #setRemoveOnCancelPolicy} to {@code true}, which
    61  * causes tasks to be immediately removed from the work queue at
    61  * causes tasks to be immediately removed from the work queue at
    62  * time of cancellation.
    62  * time of cancellation.
    63  *
    63  *
    64  * <p>Successive executions of a task scheduled via
    64  * <p>Successive executions of a task scheduled via
    65  * <code>scheduleAtFixedRate</code> or
    65  * {@code scheduleAtFixedRate} or
    66  * <code>scheduleWithFixedDelay</code> do not overlap. While different
    66  * {@code scheduleWithFixedDelay} do not overlap. While different
    67  * executions may be performed by different threads, the effects of
    67  * executions may be performed by different threads, the effects of
    68  * prior executions <a
    68  * prior executions <a
    69  * href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
    69  * href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
    70  * those of subsequent ones.
    70  * those of subsequent ones.
    71  *
    71  *
   434      *        creates a new thread
   434      *        creates a new thread
   435      * @throws IllegalArgumentException if {@code corePoolSize < 0}
   435      * @throws IllegalArgumentException if {@code corePoolSize < 0}
   436      * @throws NullPointerException if {@code threadFactory} is null
   436      * @throws NullPointerException if {@code threadFactory} is null
   437      */
   437      */
   438     public ScheduledThreadPoolExecutor(int corePoolSize,
   438     public ScheduledThreadPoolExecutor(int corePoolSize,
   439                              ThreadFactory threadFactory) {
   439                                        ThreadFactory threadFactory) {
   440         super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
   440         super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
   441               new DelayedWorkQueue(), threadFactory);
   441               new DelayedWorkQueue(), threadFactory);
   442     }
   442     }
   443 
   443 
   444     /**
   444     /**
   451      *        because the thread bounds and queue capacities are reached
   451      *        because the thread bounds and queue capacities are reached
   452      * @throws IllegalArgumentException if {@code corePoolSize < 0}
   452      * @throws IllegalArgumentException if {@code corePoolSize < 0}
   453      * @throws NullPointerException if {@code handler} is null
   453      * @throws NullPointerException if {@code handler} is null
   454      */
   454      */
   455     public ScheduledThreadPoolExecutor(int corePoolSize,
   455     public ScheduledThreadPoolExecutor(int corePoolSize,
   456                               RejectedExecutionHandler handler) {
   456                                        RejectedExecutionHandler handler) {
   457         super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
   457         super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
   458               new DelayedWorkQueue(), handler);
   458               new DelayedWorkQueue(), handler);
   459     }
   459     }
   460 
   460 
   461     /**
   461     /**
   471      * @throws IllegalArgumentException if {@code corePoolSize < 0}
   471      * @throws IllegalArgumentException if {@code corePoolSize < 0}
   472      * @throws NullPointerException if {@code threadFactory} or
   472      * @throws NullPointerException if {@code threadFactory} or
   473      *         {@code handler} is null
   473      *         {@code handler} is null
   474      */
   474      */
   475     public ScheduledThreadPoolExecutor(int corePoolSize,
   475     public ScheduledThreadPoolExecutor(int corePoolSize,
   476                               ThreadFactory threadFactory,
   476                                        ThreadFactory threadFactory,
   477                               RejectedExecutionHandler handler) {
   477                                        RejectedExecutionHandler handler) {
   478         super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
   478         super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
   479               new DelayedWorkQueue(), threadFactory, handler);
   479               new DelayedWorkQueue(), threadFactory, handler);
   480     }
   480     }
   481 
   481 
   482     /**
   482     /**