< prev index next >

test/java/rmi/transport/dgcDeadLock/DGCDeadLock.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 /* @test
  25  * @bug 4118056
  26  *
  27  * @summary synopsis: Distributed Garbage Collection Deadlock
  28  * @author Laird Dornin
  29  *
  30  * @library ../../testlibrary




  31  * @build TestLibrary Test TestImpl TestImpl_Stub
  32  * @run main/othervm/policy=security.policy/timeout=360 DGCDeadLock
  33  */
  34 
  35 /* This test attempts to cause a deadlock between the rmi leaseChecker
  36  * thread and a thread that is servicing a dgc clean call. Before the
  37  * fix for this bug was implemented, deadlock could occur when the
  38  * leaseChecker held the lock on the lease table and the clean thread
  39  * held the lock on a target x. The clean thread would attempt to get
  40  * the lock on the leaseTable to do DGCImpl.unregisterTarget and the
  41  * leaseChecker would attempt to get the lock on x to do
  42  * Target.vmidDead.  Each thread held a resource that the other thread
  43  * was attempting to lock.
  44  *
  45  * This test causes the above conditions to occur and waits to see if
  46  * a given set of remote calls finishes "quickly enough."
  47  */
  48 
  49 import java.rmi.*;
  50 import java.io.*;




  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 /* @test
  25  * @bug 4118056
  26  *
  27  * @summary synopsis: Distributed Garbage Collection Deadlock
  28  * @author Laird Dornin
  29  *
  30  * @library ../../testlibrary
  31  * @modules java.rmi/sun.rmi.registry
  32  *          java.rmi/sun.rmi.server
  33  *          java.rmi/sun.rmi.transport
  34  *          java.rmi/sun.rmi.transport.tcp
  35  * @build TestLibrary Test TestImpl TestImpl_Stub
  36  * @run main/othervm/policy=security.policy/timeout=360 DGCDeadLock
  37  */
  38 
  39 /* This test attempts to cause a deadlock between the rmi leaseChecker
  40  * thread and a thread that is servicing a dgc clean call. Before the
  41  * fix for this bug was implemented, deadlock could occur when the
  42  * leaseChecker held the lock on the lease table and the clean thread
  43  * held the lock on a target x. The clean thread would attempt to get
  44  * the lock on the leaseTable to do DGCImpl.unregisterTarget and the
  45  * leaseChecker would attempt to get the lock on x to do
  46  * Target.vmidDead.  Each thread held a resource that the other thread
  47  * was attempting to lock.
  48  *
  49  * This test causes the above conditions to occur and waits to see if
  50  * a given set of remote calls finishes "quickly enough."
  51  */
  52 
  53 import java.rmi.*;
  54 import java.io.*;


< prev index next >