Mercurial > hg > Database > Alice
view src/alice/codesegment/CodeSegmentManager.java @ 20:0bb03861b5cd
set name to Thread
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Jan 2012 18:44:25 +0900 |
parents | 78b415d019de |
children | 145667a554ad |
line wrap: on
line source
package alice.codesegment; import java.util.concurrent.LinkedBlockingQueue; public class CodeSegmentManager { private static CodeSegmentManager instance = new CodeSegmentManager(); public LinkedBlockingQueue<CodeSegment> readyQueue = new LinkedBlockingQueue<CodeSegment>(); private CodeSegmentManager() { Runnable prepareThread = new Runnable() { @Override public void run() { while (true) { try { CodeSegment cs = readyQueue.take(); cs.run(); } catch (InterruptedException e) { e.printStackTrace(); } } } }; new Thread(prepareThread, "CodeSegmentManager").start(); } public void create(CodeSegment cs) { } public static CodeSegmentManager get() { return instance; } }