Author: echatellier Date: 2012-04-16 17:07:37 +0200 (Mon, 16 Apr 2012) New Revision: 527 Url: http://nuiton.org/repositories/revision/sandbox/527 Log: Add test on deamon/non-deamon threads Added: misctestproject/trunk/src/main/java/org/nuiton/test/thread/ misctestproject/trunk/src/main/java/org/nuiton/test/thread/TestThreads.java misctestproject/trunk/src/main/java/org/nuiton/test/thread/ThreadA.java Added: misctestproject/trunk/src/main/java/org/nuiton/test/thread/TestThreads.java =================================================================== --- misctestproject/trunk/src/main/java/org/nuiton/test/thread/TestThreads.java (rev 0) +++ misctestproject/trunk/src/main/java/org/nuiton/test/thread/TestThreads.java 2012-04-16 15:07:37 UTC (rev 527) @@ -0,0 +1,37 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.nuiton.test.thread; + +public class TestThreads { + + public static void main(String... args) { + ThreadA ta = new ThreadA(); + ta.setDaemon(true); + ta.start(); + + System.out.println("exit main thread"); + } +} Property changes on: misctestproject/trunk/src/main/java/org/nuiton/test/thread/TestThreads.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: misctestproject/trunk/src/main/java/org/nuiton/test/thread/ThreadA.java =================================================================== --- misctestproject/trunk/src/main/java/org/nuiton/test/thread/ThreadA.java (rev 0) +++ misctestproject/trunk/src/main/java/org/nuiton/test/thread/ThreadA.java 2012-04-16 15:07:37 UTC (rev 527) @@ -0,0 +1,43 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.nuiton.test.thread; + +public class ThreadA extends Thread { + + @Override + public void run() { + for (int i = 1 ; i < 100 ; i++) { + System.out.println("Thread A = " + i); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + +} Property changes on: misctestproject/trunk/src/main/java/org/nuiton/test/thread/ThreadA.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL