コード例 #1
0
 public void run() {
   try {
     while (!Thread.interrupted()) {
       Event event = q.take();
       print(event);
       event.run();
     }
   } catch (InterruptedException e) {
     // Acceptable way to exit
   }
   print("Finished Controller");
 }
コード例 #2
0
 public void addEvent(Event c) {
   c.start();
   q.put(c);
 }