jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java
changeset 38344 81b7cf716427
parent 36233 f85ed703cf7e
child 43522 f9c6f543c4db
equal deleted inserted replaced
38343:8c2db7e479ae 38344:81b7cf716427
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   165 
   165 
   166     static int objectsInUse(final Process child,
   166     static int objectsInUse(final Process child,
   167                             final String childPid,
   167                             final String childPid,
   168                             final String className) {
   168                             final String className) {
   169         final String regex =
   169         final String regex =
   170             "(?m)^ *[0-9]+: +([0-9]+) +[0-9]+ +\\Q"+className+"\\E$";
   170             "(?m)^ *[0-9]+: +([0-9]+) +[0-9]+ +\\Q"+className+"\\E(?:$| )";
   171         final Callable<Integer> objectsInUse =
   171         final Callable<Integer> objectsInUse =
   172             new Callable<Integer>() { public Integer call() {
   172             new Callable<Integer>() { public Integer call() {
   173                 Integer i = Integer.parseInt(
   173                 Integer i = Integer.parseInt(
   174                     match(commandOutputOf(jmap, "-histo:live", childPid),
   174                     match(commandOutputOf(jmap, "-histo:live", childPid),
   175                           regex, 1));
   175                           regex, 1));