< prev index next >

test/runtime/Thread/TestThreadDumpMonitorContention.java

Print this page




  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  * @test
  26  * @bug     8036823
  27  * @bug     8046287
  28  * @summary Creates two threads contending for the same lock and checks
  29  *      whether jstack reports "locked" by more than one thread.
  30  *
  31  * @library /testlibrary

  32  * @run main/othervm TestThreadDumpMonitorContention
  33  */
  34 
  35 import java.io.BufferedReader;
  36 import java.io.InputStreamReader;
  37 import java.lang.management.ManagementFactory;
  38 import java.lang.management.RuntimeMXBean;
  39 import java.util.ArrayList;
  40 import java.util.List;
  41 import java.util.regex.Matcher;
  42 import java.util.regex.Pattern;
  43 
  44 import com.oracle.java.testlibrary.*;
  45 
  46 public class TestThreadDumpMonitorContention {
  47     // jstack tends to be closely bound to the VM that we are running
  48     // so use getTestJDKTool() instead of getCompileJDKTool() or even
  49     // getJDKTool() which can fall back to "compile.jdk".
  50     final static String JSTACK = JDKToolFinder.getTestJDKTool("jstack");
  51     final static String PID = getPid();




  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  * @test
  26  * @bug     8036823
  27  * @bug     8046287
  28  * @summary Creates two threads contending for the same lock and checks
  29  *      whether jstack reports "locked" by more than one thread.
  30  *
  31  * @library /testlibrary
  32  * @build com.oracle.java.testlibrary.*
  33  * @run main/othervm TestThreadDumpMonitorContention
  34  */
  35 
  36 import java.io.BufferedReader;
  37 import java.io.InputStreamReader;
  38 import java.lang.management.ManagementFactory;
  39 import java.lang.management.RuntimeMXBean;
  40 import java.util.ArrayList;
  41 import java.util.List;
  42 import java.util.regex.Matcher;
  43 import java.util.regex.Pattern;
  44 
  45 import com.oracle.java.testlibrary.*;
  46 
  47 public class TestThreadDumpMonitorContention {
  48     // jstack tends to be closely bound to the VM that we are running
  49     // so use getTestJDKTool() instead of getCompileJDKTool() or even
  50     // getJDKTool() which can fall back to "compile.jdk".
  51     final static String JSTACK = JDKToolFinder.getTestJDKTool("jstack");
  52     final static String PID = getPid();


< prev index next >