X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/611d822b02f836d7abe031cced6adc4281ef4356..HEAD:/teshsuite/java/semaphoregc/SemaphoreGC.java diff --git a/teshsuite/java/semaphoregc/SemaphoreGC.java b/teshsuite/java/semaphoregc/SemaphoreGC.java deleted file mode 100644 index 6544ef0b91..0000000000 --- a/teshsuite/java/semaphoregc/SemaphoreGC.java +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2016-2018. The SimGrid Team. All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -/* This test ensures that the used semaphores are not garbage-collected while we still use it. - * This was reported as bug #19893 on gforge. - */ - -package semaphoregc; - -import org.simgrid.msg.*; -import org.simgrid.msg.Process; - -class SemCreator extends Process { - SemCreator(Host h, String n){ - super(h, n); - } - - public void main(String[] args) throws MsgException{ - int j; - Msg.info("Creating 50 new Semaphores, yielding and triggering a GC after each"); - for(j = 1; j <= 50; j++) { - new Semaphore(0); - waitFor(10); - System.gc(); - } - Msg.info("It worked, we survived. The test is passed."); - } -} - -public class SemaphoreGC { - private SemaphoreGC() { - throw new IllegalAccessError("Utility class"); - } - - public static void main(String[] args) throws Exception { - Msg.init(args); - if (args.length < 1) { - Msg.info("Usage: java -cp simgrid.jar:. semaphoregc.SemaphoreGC "); - System.exit(1); - } - Msg.createEnvironment(args[0]); - - new SemCreator(Host.getByName("Fafard"), "SemCreator").start(); - - Msg.run(); - } -}