< prev index next >

test/serviceability/threads/TestFalseDeadLock.java

Print this page




  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 import com.oracle.java.testlibrary.Utils;
  25 import java.lang.management.ManagementFactory;
  26 import java.lang.management.ThreadMXBean;
  27 import java.util.Random;
  28 
  29 /*
  30  * @test
  31  * @ignore 8061157
  32  * @bug 8016304
  33  * @summary Make sure no deadlock is reported for this program which has no deadlocks.
  34  * @library /testlibrary


  35  * @run main/othervm TestFalseDeadLock
  36  */
  37 
  38 /*
  39  * This test will not provoke the bug every time it is run since the bug is intermittent.
  40  * The test has a fixed running time of 5 seconds.
  41  */
  42 
  43 public class TestFalseDeadLock {
  44     private static ThreadMXBean bean;
  45     private static volatile boolean running = true;
  46     private static volatile boolean found = false;
  47 
  48     public static void main(String[] args) throws Exception {
  49         bean = ManagementFactory.getThreadMXBean();
  50         Thread[] threads = new Thread[500];
  51         for (int i = 0; i < threads.length; i++) {
  52             Test t = new Test();
  53             threads[i] = new Thread(t);
  54             threads[i].start();




  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 import com.oracle.java.testlibrary.Utils;
  25 import java.lang.management.ManagementFactory;
  26 import java.lang.management.ThreadMXBean;
  27 import java.util.Random;
  28 
  29 /*
  30  * @test

  31  * @bug 8016304
  32  * @summary Make sure no deadlock is reported for this program which has no deadlocks.
  33  * @library /testlibrary
  34  * @ignore 8061157
  35  * @build com.oracle.java.testlibrary.*
  36  * @run main/othervm TestFalseDeadLock
  37  */
  38 
  39 /*
  40  * This test will not provoke the bug every time it is run since the bug is intermittent.
  41  * The test has a fixed running time of 5 seconds.
  42  */
  43 
  44 public class TestFalseDeadLock {
  45     private static ThreadMXBean bean;
  46     private static volatile boolean running = true;
  47     private static volatile boolean found = false;
  48 
  49     public static void main(String[] args) throws Exception {
  50         bean = ManagementFactory.getThreadMXBean();
  51         Thread[] threads = new Thread[500];
  52         for (int i = 0; i < threads.length; i++) {
  53             Test t = new Test();
  54             threads[i] = new Thread(t);
  55             threads[i].start();


< prev index next >