All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.anarsoft.vmlens.concurrent.junit.TestUtil Maven / Gradle / Ivy

The newest version!
package com.anarsoft.vmlens.concurrent.junit;

import java.util.LinkedList;
import java.util.List;

public class TestUtil {

	
	
	public static void runMultithreaded(Runnable  runnable, int threadCount) throws InterruptedException
	{
		List  threadList = new LinkedList();
		
		for(int i = 0 ; i < threadCount; i++)
		{
			threadList.add(new Thread(runnable));
		}
		
		for( Thread t :  threadList)
		{
			t.start();
		}
		
		
		for( Thread t :  threadList)
		{
			t.join();
		}
		
		
		
		
	}
	
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy