home *** CD-ROM | disk | FTP | other *** search
- public class CounterThread extends Thread {
- private Form_Threads _parent;
- private int _threadNumber;
- private int _counter;
-
- public CounterThread(Form_Threads var1, int var2) {
- this._parent = var1;
- this._threadNumber = var2;
- }
-
- public void run() {
- while(true) {
- ++this._counter;
- if (this._counter > 1000) {
- this._counter = 0;
- }
-
- synchronized(this) {
- this._parent.updateCounter(this._threadNumber, this._counter);
- }
- }
- }
- }
-