@Override
	public void executeCurrentTasks() {

		// System.out.println("Thread: " + threadId + " is executing a task");

		setThreadState(THREAD_STATE.RUNNING);
		// System.out.println("Task list size: " + taskList.size());
		for (int i = 0; i < taskList.size(); i++) {
			Task task = taskList.remove(i);
			// System.out.println("Executing task " + task.getTaskId()
			// + " on thread " + getThreadId());

			taskCallback = task.getTaskCallback();

			if (taskCallback != null) {
				taskCallback.onTaskStart(task);
			}
			task.beginTask(this);

			do {
				if (getThreadState() == THREAD_STATE.FINISHED) {
					stopThread();
				}
			} while (getThreadState() != THREAD_STATE.READY_FOR_NEXT_TASK
					|| getThreadState() != THREAD_STATE.FINISHED);
		}

	}