jdk/test/java/nio/channels/AsynchronousFileChannel/CustomThreadPool.java
changeset 3632 399359a027de
parent 2057 3acf8e5e2ca0
child 5506 202f599c92aa
equal deleted inserted replaced
3631:4dc04372d56b 3632:399359a027de
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
    21  * have any questions.
    22  */
    22  */
    23 
    23 
    24 /* @test
    24 /* @test
    25  * @bug 4607272
    25  * @bug 4607272 6842687
    26  * @summary Unit test for java.nio.channels.AsynchronousFileChannel
    26  * @summary Unit test for java.nio.channels.AsynchronousFileChannel
    27  * @build CustomThreadPool MyThreadFactory
    27  * @build CustomThreadPool MyThreadFactory
    28  * @run main/othervm -Djava.nio.channels.DefaultThreadPool.threadFactory=MyThreadFactory CustomThreadPool
    28  * @run main/othervm -Djava.nio.channels.DefaultThreadPool.threadFactory=MyThreadFactory CustomThreadPool
    29  */
    29  */
    30 
    30 
    49                 public void completed(Integer result, AtomicReference<Thread> invoker) {
    49                 public void completed(Integer result, AtomicReference<Thread> invoker) {
    50                     invoker.set(Thread.currentThread());
    50                     invoker.set(Thread.currentThread());
    51                 }
    51                 }
    52                 public void failed(Throwable exc, AtomicReference<Thread> invoker) {
    52                 public void failed(Throwable exc, AtomicReference<Thread> invoker) {
    53                 }
    53                 }
    54                 public void cancelled(AtomicReference<Thread> invoker) {
       
    55                 }
       
    56             });
    54             });
    57         Thread t;
    55         Thread t;
    58         while ((t = invoker.get()) == null) {
    56         while ((t = invoker.get()) == null) {
    59             Thread.sleep(100);
    57             Thread.sleep(100);
    60         }
    58         }