public void run() {
            threadStarted();

            while (!isInterrupted()) {


                Runnable task = null;
                try {
                    task = getTask();
                }
                catch (InterruptedException ex) { }

                if (task == null) {
                    break;
                }


                try {
                    task.run();
                }
                catch (Throwable t) {
                    uncaughtException(this, t);
                }
            }

            threadStopped();
        }