package game.net.test2;

import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

public class Test_thread implements Runnable {


	public static void main(String[] args) throws InterruptedException {
		ThreadFactory factory = Executors.defaultThreadFactory();

		Test_thread t = new Test_thread();


		Thread t1 = factory.newThread(t);
		Thread t2 = factory.newThread(t);


		t1.start();
		t2.start();


		t1.join();
		t2.join();


		System.out.println("end");
	}


	public void run() {
		System.out.println("message1");
	}

}
class SimpleThreadFactory implements ThreadFactory {

	public Thread newThread(Runnable r) {
		return new Thread(r);
	}

}
