public void run() {
		if (debug) System.err.println("+" + this.getName());
		while (!mQueue.isShutdown() && !isKillSw()) {
			try {
				final BaseWorkTask task = mQueue.dequeue();
				if (task != null) {
					task.setExecutedBy(this.getName());	//give the task the worker's name
					task.setConnection(conn);	//give the task the worker's connection
					task.setTimer(timer);
					setWorking(true);
					task.run();		//process task
					setWorking(false);
					mQueue.addIdle(task);
				}
			} catch (Throwable e) {
				// NOTE: tasks *must* handle their own errors
				e.printStackTrace();
				setWorking(false);
			}
		}

		if (debug) System.err.println("-" + this.getName());
		
		//When this worker stops, decrement total count of active workers
		counter--;
	}