public void stop() throws UnsupportedOperationException {
		if (!canBeStopped()) {
			throw new UnsupportedOperationException("Stop not supported");
		}
		boolean joinit = false;
		synchronized (lock) {
			if (thread != null && !stopped) {
				stopped = true;
				if (paused) {
					resume();
				}
				notifyExecutionStopping();
				thread.interrupt();
				joinit = true;
			}
		}
		if (joinit) {
			do {
				try {
					thread.join();
					break;
				} catch (InterruptedException e) {
					continue;
				}
			} while (true);
			thread = null;
		}
	}