< prev index next >

test/compiler/c2/InterruptedTest.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /*
  26  * @test
  27  * @bug 6772683
  28  * @summary Thread.isInterrupted() fails to return true on multiprocessor PC
  29  * @run main/othervm InterruptedTest 100

  30  */


  31 
  32 public class InterruptedTest {
  33 
  34     public static void main(String[] args) throws Exception {
  35         /* The value of the threshold determines for how many seconds
  36          * the main thread must wait for the worker thread. On highly
  37          * loaded systems it can take a while until the worker thread
  38          * obtains CPU time and is able to check if it was interrupted
  39          * by the main thread. The higher the threshold the likelier
  40          * the worker thread can check if it was interrupted (that is
  41          * required for successul test execution).
  42          */
  43         int threshold = 100;
  44 
  45         if (args.length != 1) {
  46             System.out.println("Incorrect number of arguments");
  47             System.exit(1);
  48         }
  49 
  50         try {




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /*
  26  * @test
  27  * @bug 6772683
  28  * @summary Thread.isInterrupted() fails to return true on multiprocessor PC
  29  *
  30  * @run main/othervm compiler.c2.InterruptedTest 100
  31  */
  32 
  33 package compiler.c2;
  34 
  35 public class InterruptedTest {
  36 
  37     public static void main(String[] args) throws Exception {
  38         /* The value of the threshold determines for how many seconds
  39          * the main thread must wait for the worker thread. On highly
  40          * loaded systems it can take a while until the worker thread
  41          * obtains CPU time and is able to check if it was interrupted
  42          * by the main thread. The higher the threshold the likelier
  43          * the worker thread can check if it was interrupted (that is
  44          * required for successul test execution).
  45          */
  46         int threshold = 100;
  47 
  48         if (args.length != 1) {
  49             System.out.println("Incorrect number of arguments");
  50             System.exit(1);
  51         }
  52 
  53         try {


< prev index next >