6050N/A * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 6050N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6050N/A * This code is free software; you can redistribute it and/or modify it 6050N/A * under the terms of the GNU General Public License version 2 only, as 6050N/A * published by the Free Software Foundation. 6050N/A * This code is distributed in the hope that it will be useful, but WITHOUT 6050N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6050N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6050N/A * version 2 for more details (a copy is included in the LICENSE file that 6050N/A * You should have received a copy of the GNU General Public License version 6050N/A * 2 along with this work; if not, write to the Free Software Foundation, 6050N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6050N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 6050N/A * or visit www.oracle.com if you need additional information or have any 6050N/A * @summary Tests interruption of threads doing position-based read methods in 6050N/A * an attempt to provoke a deadlock between position sensitive and position 6050N/A * A thread that continuously reads from a FileChannel with 6050N/A * read(ByteBuffer,long). The thread terminates when interrupted and/or 6050N/A * the FileChannel is closed. 6050N/A // fc.size is important here as it is position sensitive 6050N/A // the number of reader threads to start 6050N/A for (
int i=
1; i<=
20; i++) {
6050N/A // give readers a bit of time to get started (not strictly required) 6050N/A // interrupt and wait for the readers to terminate 6050N/A // the channel should not be open at this point