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 {
			
			//serverlist_list.lock.lock();
			//serverlist_list.syntask.reduce_memory(serverlist_list, tasklist_list);
			//serverlist_list.lock.unlock();;
			
			Thread.sleep(tasklist_list.get_time());
			
			serverlist_list.lock.lock();
			
			serverlist_list.syntask.add_memory(serverlist_list, tasklist_list);
			
			serverlist_list.lock.unlock();
			
			System.out.println("执行完成："+tasklist_list.get_taskName());

			//线程自带自杀自己
			this.interrupt();
			
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	

}
