import java.util.*;

public class TaskThread extends Thread  
{
	private SeverList serverlist_list = null;
	private TaskList tasklist_list = null;
	
	public TaskThread(SeverList serverlist,TaskList tasklist_list)
	{
		this.serverlist_list=serverlist;
		this.tasklist_list= tasklist_list;
	}
	
	public void run() 
	{
		//恢复内存
		try {
			
			Thread.sleep(tasklist_list.get_time());
			
			serverlist_list.rest_Memory = serverlist_list.rest_Memory + tasklist_list.get_need_Memory();
			
			System.out.println("执行完成："+tasklist_list.get_taskName());
			
			serverlist_list.exec_task++;
			//线程自带自杀自己
			this.interrupt();
			
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}


}
