1 /*
2 * Created on Nov 5, 2003
3 *
4 * Copyright neotechnologies.org
5 */
6 package org.neo.swarm.util.threads;
7
8 /***
9 * Represents a UnitOfWork to be executed in by the ThreadPool
10 *
11 * @author neil.avery
12 */
13 class TestThreadRunner implements Runnable {
14 static int count;
15 int key;
16
17 // default ctor
18 TestThreadRunner(int key) {
19 this.key = key;
20 }
21
22 // loop forever waiting for work to do
23 public synchronized void run() {
24 try {
25 // sleep and release object lock
26 for (int i = 0; i < 1000; i++) {
27 }
28 // System.out.println(this.key + " done");
29 count++;
30 } catch (Exception e) {
31 e.printStackTrace();
32 }
33
34 }
35 }