
public class AllocatetaskThread  extends Thread 
{

	
	private SeverList serverlist_list = null;
	private TaskList tasklist_list = null;
	private TaskList tasklist_last =  null;
	
	public AllocatetaskThread(SeverList serverlist)
	{
		this.serverlist_list=serverlist;
		this.tasklist_list= serverlist_list.importTask.getNext();
		tasklist_last = tasklist_list;
	}
	
	public   void run() 
	{
		//恢复内存
		try {
			//循环处理，直到为空
			while()
			//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());
				
				serverlist_list.isDispose = true;
				
				//保证连头不变，并去掉一个任务
				serverlist_list.importTask.setNext(serverlist_list.importTask.getNext());
				
			//线程自带自杀自己
			this.interrupt();
			
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	


}


































